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 |
---|---|
125 | ); |
126 |
|
127 | $r = wp_parse_args( $args, $defaults ); |
128 | extract( $r, EXTR_SKIP ); |
129 |
|
130 | $cache = array(); |
131 | $key = md5( serialize( $r ) ); |
132 | if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { |
133 | if ( is_array($cache) && isset( $cache[ $key ] ) ) |
134 | return apply_filters('get_bookmarks', $cache[ $key ], $r ); |
135 | } |
136 |
|
137 | if ( !is_array($cache) ) |
138 | $cache = array(); |
139 |
|
140 | $inclusions = ''; |
141 | if ( !empty($include) ) { |
142 | $exclude = ''; //ignore exclude, category, and category_name params if using include |
143 | $category = ''; |
Line | Code |
170 | if (!empty($exclusions)) |
171 | $exclusions .= ')'; |
172 |
|
173 | if ( !empty($category_name) ) { |
174 | if ( $category = get_term_by('name', $category_name, 'link_category') ) { |
175 | $category = $category->term_id; |
176 | } else { |
177 | $cache[ $key ] = array(); |
178 | wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); |
179 | return apply_filters( 'get_bookmarks', array(), $r ); |
180 | } |
181 | } |
182 |
|
183 | if ( ! empty($search) ) { |
184 | $search = like_escape($search); |
185 | $search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) "; |
186 | } |
187 |
|
188 | $category_query = ''; |
Line | Code |
239 | $query .= " ORDER BY $orderby $order"; |
240 | if ($limit != -1) |
241 | $query .= " LIMIT $limit"; |
242 |
|
243 | $results = $wpdb->get_results($query); |
244 |
|
245 | $cache[ $key ] = $results; |
246 | wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); |
247 |
|
248 | return apply_filters('get_bookmarks', $results, $r); |
249 | } |
250 |
|
251 | /** |
252 | * Sanitizes all bookmark fields |
253 | * |
254 | * @since 2.3.0 |
255 | * |
256 | * @param object|array $bookmark Bookmark row |
257 | * @param string $context Optional, default is 'display'. How to filter the |