Ticket #25468: 25468.4.diff
File 25468.4.diff, 2.3 KB (added by , 11 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 instance of the filter returns the cached bookmarks 144 * list. The second instance returns a cached bookmarks list if the 145 * link category is passed but doesn't exist. The third instance 146 * returns the full cached results. 147 * 148 * @since 2.1.0 149 * 150 * @param array $bookmarks List of the cached bookmarks. 151 * @param array $r An array of bookmark query arguments. @see get_bookmarks() 152 */ 153 return apply_filters( 'get_bookmarks', $bookmarks, $r ); 140 154 } 141 155 142 156 if ( !is_array($cache) ) … … 181 195 } else { 182 196 $cache[ $key ] = array(); 183 197 wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); 198 //duplicate_hook 184 199 return apply_filters( 'get_bookmarks', array(), $r ); 185 200 } 186 201 } … … 263 278 $cache[ $key ] = $results; 264 279 wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); 265 280 266 return apply_filters('get_bookmarks', $results, $r); 281 //duplicate_hook 282 return apply_filters( 'get_bookmarks', $results, $r ); 267 283 } 268 284 269 285 /** … … 352 368 return $value; 353 369 354 370 if ( 'edit' == $context ) { 355 $value = apply_filters("edit_$field", $value, $bookmark_id); 371 //duplicate_hook 372 $value = apply_filters( "edit_$field", $value, $bookmark_id ); 356 373 357 374 if ( 'link_notes' == $field ) { 358 375 $value = esc_html( $value ); // textarea_escaped … … 360 377 $value = esc_attr($value); 361 378 } 362 379 } else if ( 'db' == $context ) { 363 $value = apply_filters("pre_$field", $value); 380 //duplicate_hook 381 $value = apply_filters( "pre_$field", $value ); 364 382 } else { 365 // Use display filters by default.366 $value = apply_filters( $field, $value, $bookmark_id, $context);383 //duplicate_hook 384 $value = apply_filters( $field, $value, $bookmark_id, $context ); 367 385 368 386 if ( 'attribute' == $context ) 369 387 $value = esc_attr($value);