Ticket #25468: 25468.2.diff
File 25468.2.diff, 2.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/bookmark.php
136 136 $key = md5( serialize( $r ) ); 137 137 if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { 138 138 if ( is_array($cache) && isset( $cache[ $key ] ) ) 139 return apply_filters('get_bookmarks', $cache[ $key ], $r ); 139 $bookmarks = $cache[ $key ]; 140 /** 141 * Filter the returned list of bookmarks. 142 * 143 * The first time the hook is evaluated in this file, it returns the cached 144 * bookmarks list. The second evaluation returns a cached bookmarks list if the 145 * link category is passed but does not exist. The third evaluation returns 146 * the full cached results. 147 * 148 * @since 2.1.0 149 * 150 * @see get_bookmarks() 151 * 152 * @param array $bookmarks List of the cached bookmarks. 153 * @param array $r An array of bookmark query arguments. 154 */ 155 return apply_filters( 'get_bookmarks', $bookmarks, $r ); 140 156 } 141 157 142 158 if ( !is_array($cache) ) … … 181 197 } else { 182 198 $cache[ $key ] = array(); 183 199 wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); 200 /** This filter is documented in wp-includes/bookmark.php */ 184 201 return apply_filters( 'get_bookmarks', array(), $r ); 185 202 } 186 203 } … … 263 280 $cache[ $key ] = $results; 264 281 wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); 265 282 266 return apply_filters('get_bookmarks', $results, $r); 283 /** This filter is documented in wp-includes/bookmark.php */ 284 return apply_filters( 'get_bookmarks', $results, $r ); 267 285 } 268 286 269 287 /** … … 352 370 return $value; 353 371 354 372 if ( 'edit' == $context ) { 355 $value = apply_filters("edit_$field", $value, $bookmark_id); 373 /** This filter is documented in wp-includes/post.php */ 374 $value = apply_filters( "edit_$field", $value, $bookmark_id ); 356 375 357 376 if ( 'link_notes' == $field ) { 358 377 $value = esc_html( $value ); // textarea_escaped … … 360 379 $value = esc_attr($value); 361 380 } 362 381 } else if ( 'db' == $context ) { 363 $value = apply_filters("pre_$field", $value); 382 /** This filter is documented in wp-includes/post.php */ 383 $value = apply_filters( "pre_$field", $value ); 364 384 } else { 365 / / Use display filters by default.366 $value = apply_filters( $field, $value, $bookmark_id, $context);385 /** This filter is documented in wp-includes/post.php */ 386 $value = apply_filters( $field, $value, $bookmark_id, $context ); 367 387 368 388 if ( 'attribute' == $context ) 369 389 $value = esc_attr($value);