[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

Link/Bookmark API

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

Defines 6 functions

  get_bookmark()
  get_bookmark_field()
  get_bookmarks()
  sanitize_bookmark()
  sanitize_bookmark_field()
  clean_bookmark_cache()

Functions
Functions that are not part of a class:

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

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'.
return: array|object|null Type returned depends on $output value.

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

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. Default 'display'.
return: string|WP_Error

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.

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

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

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

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.

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',
return: mixed The filtered value.

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

param: int $bookmark_id Bookmark ID.



Generated : Tue Dec 24 08:20:01 2024 Cross-referenced by PHPXref