sanitize_bookmark_field( string $field, mixed $value, int $bookmark_id, string $context )
Sanitizes a bookmark field.
Description
Sanitizes the bookmark fields based on what the field name is. If the field has a strict value set, then it will be tested for that, else a more generic filtering is applied. After the more strict filter is applied, if the $context is ‘raw’ then the value is immediately return.
Hooks exist for the more generic cases. With the ‘edit’ context, the ‘edit_$field’ filter will be called and passed the $value and $bookmark_id respectively.
With the ‘db’ context, the ‘pre_$field’ filter is called and passed the value.
The ‘display’ context is the final context and has the $field has the filter name and is passed the $value, $bookmark_id, and $context, respectively.
Parameters
- $field
-
(Required) The bookmark field.
- $value
-
(Required) The bookmark field value.
- $bookmark_id
-
(Required) Bookmark ID.
- $context
-
(Required) How to filter the field value. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'. Default 'display'.
Return
(mixed) The filtered value.
Source
File: wp-includes/bookmark.php
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |