Inline documentation for hooks in wp-includes/bookmark.php.

Props ShinichiN, kpdesign.
Fixes #25468.

Built from https://develop.svn.wordpress.org/trunk@25934


git-svn-id: http://core.svn.wordpress.org/trunk@25893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2013-10-26 16:53:09 +00:00
parent bba2a414a2
commit 3c22a3fd6d
1 changed files with 26 additions and 6 deletions

View File

@ -136,7 +136,23 @@ function get_bookmarks($args = '') {
$key = md5( serialize( $r ) ); $key = md5( serialize( $r ) );
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
if ( is_array($cache) && isset( $cache[ $key ] ) ) if ( is_array($cache) && isset( $cache[ $key ] ) )
return apply_filters('get_bookmarks', $cache[ $key ], $r ); $bookmarks = $cache[ $key ];
/**
* Filter the returned list of bookmarks.
*
* The first time the hook is evaluated in this file, it returns the cached
* bookmarks list. The second evaluation returns a cached bookmarks list if the
* link category is passed but does not exist. The third evaluation returns
* the full cached results.
*
* @since 2.1.0
*
* @see get_bookmarks()
*
* @param array $bookmarks List of the cached bookmarks.
* @param array $r An array of bookmark query arguments.
*/
return apply_filters( 'get_bookmarks', $bookmarks, $r );
} }
if ( !is_array($cache) ) if ( !is_array($cache) )
@ -181,6 +197,7 @@ function get_bookmarks($args = '') {
} else { } else {
$cache[ $key ] = array(); $cache[ $key ] = array();
wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
/** This filter is documented in wp-includes/bookmark.php */
return apply_filters( 'get_bookmarks', array(), $r ); return apply_filters( 'get_bookmarks', array(), $r );
} }
} }
@ -263,6 +280,7 @@ function get_bookmarks($args = '') {
$cache[ $key ] = $results; $cache[ $key ] = $results;
wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
/** This filter is documented in wp-includes/bookmark.php */
return apply_filters( 'get_bookmarks', $results, $r ); return apply_filters( 'get_bookmarks', $results, $r );
} }
@ -352,6 +370,7 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
return $value; return $value;
if ( 'edit' == $context ) { if ( 'edit' == $context ) {
/** This filter is documented in wp-includes/post.php */
$value = apply_filters( "edit_$field", $value, $bookmark_id ); $value = apply_filters( "edit_$field", $value, $bookmark_id );
if ( 'link_notes' == $field ) { if ( 'link_notes' == $field ) {
@ -360,9 +379,10 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
$value = esc_attr($value); $value = esc_attr($value);
} }
} else if ( 'db' == $context ) { } else if ( 'db' == $context ) {
/** This filter is documented in wp-includes/post.php */
$value = apply_filters( "pre_$field", $value ); $value = apply_filters( "pre_$field", $value );
} else { } else {
// Use display filters by default. /** This filter is documented in wp-includes/post.php */
$value = apply_filters( $field, $value, $bookmark_id, $context ); $value = apply_filters( $field, $value, $bookmark_id, $context );
if ( 'attribute' == $context ) if ( 'attribute' == $context )