WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 3 times in this file.
Line | Code |
---|---|
141 | * the full cached results. |
142 | * |
143 | * @since 2.1.0 |
144 | * |
145 | * @see get_bookmarks() |
146 | * |
147 | * @param array $bookmarks List of the cached bookmarks. |
148 | * @param array $r An array of bookmark query arguments. |
149 | */ |
150 | return apply_filters( 'get_bookmarks', $bookmarks, $r ); |
151 | } |
152 | } |
153 |
|
154 | if ( ! is_array( $cache ) ) { |
155 | $cache = array(); |
156 | } |
157 |
|
158 | $inclusions = ''; |
159 | if ( ! empty( $r['include'] ) ) { |
Line | Code |
193 | } |
194 |
|
195 | if ( ! empty( $r['category_name'] ) ) { |
196 | if ( $r['category'] = get_term_by('name', $r['category_name'], 'link_category') ) { |
197 | $r['category'] = $r['category']->term_id; |
198 | } else { |
199 | $cache[ $key ] = array(); |
200 | wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); |
201 | /** This filter is documented in wp-includes/bookmark.php */ |
202 | return apply_filters( 'get_bookmarks', array(), $r ); |
203 | } |
204 | } |
205 |
|
206 | $search = ''; |
207 | if ( ! empty( $r['search'] ) ) { |
208 | $like = '%' . $wpdb->esc_like( $r['search'] ) . '%'; |
209 | $search = $wpdb->prepare(" AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ", $like, $like, $like ); |
210 | } |
211 |
|
Line | Code |
284 | $query .= ' LIMIT ' . $r['limit']; |
285 | } |
286 |
|
287 | $results = $wpdb->get_results( $query ); |
288 |
|
289 | $cache[ $key ] = $results; |
290 | wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); |
291 |
|
292 | /** This filter is documented in wp-includes/bookmark.php */ |
293 | return apply_filters( 'get_bookmarks', $results, $r ); |
294 | } |
295 |
|
296 | /** |
297 | * Sanitizes all bookmark fields |
298 | * |
299 | * @since 2.3.0 |
300 | * |
301 | * @param object|array $bookmark Bookmark row |
302 | * @param string $context Optional, default is 'display'. How to filter the |