[ Index ]

PHP Cross Reference of WordPress




/wp-includes/ -> bookmark.php (summary)

Link/Bookmark API

File Size: 468 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 6 functions


Functions that are not part of a class:

get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' )   X-Ref
Retrieve Bookmark data

since: 2.1.0
return: array|object|null Type returned depends on $output value.
param: int|stdClass $bookmark
param: string       $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
param: string       $filter   Optional. How to sanitize bookmark fields. Default 'raw'.

get_bookmark_field( $field, $bookmark, $context = 'display' )   X-Ref
Retrieve single bookmark data item or field.

since: 2.3.0
return: string|WP_Error
param: string $field    The name of the data field to return.
param: int    $bookmark The bookmark ID to get field.
param: string $context  Optional. The context of how the field will be used.

get_bookmarks( $args = '' )   X-Ref
Retrieves the list of bookmarks

Attempts to retrieve from the cache first based on MD5 hash of arguments. If
that fails, then the query will be built from the arguments and executed. The
results will be stored to the cache.

since: 2.1.0
return: object[] List of bookmark row objects.
param: string|array $args {

sanitize_bookmark( $bookmark, $context = 'display' )   X-Ref
Sanitizes all bookmark fields.

since: 2.3.0
return: stdClass|array Same type as $bookmark but with fields sanitized.
param: stdClass|array $bookmark Bookmark row.
param: string         $context  Optional. How to filter the fields. Default 'display'.

sanitize_bookmark_field( $field, $value, $bookmark_id, $context )   X-Ref
Sanitizes a bookmark field.

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 {@see 'edit_$field'}
filter will be called and passed the `$value` and `$bookmark_id` respectively.

With the 'db' context, the {@see '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.

since: 2.3.0
return: mixed The filtered value.
param: string $field       The bookmark field.
param: mixed  $value       The bookmark field value.
param: int    $bookmark_id Bookmark ID.
param: string $context     How to filter the field value. Accepts 'raw', 'edit', 'db',

clean_bookmark_cache( $bookmark_id )   X-Ref
Deletes the bookmark cache.

since: 2.7.0
param: int $bookmark_id Bookmark ID.

Generated: Mon May 20 01:00:02 2024 Cross-referenced by PHPXref 0.7.1