Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_bookmarks

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
124           'exclude' => '', 'search' => ''
125      );
126
127      $r = wp_parse_args( $args, $defaults );
128      extract( $r, EXTR_SKIP );
129
130      $key = md5( serialize( $r ) );
131      if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
132           if ( isset( $cache[ $key ] ) )
133                return apply_filters('get_bookmarks', $cache[ $key ], $r );
134
135      $inclusions = '';
136      if ( !empty($include) ) {
137           $exclude = '';  //ignore exclude, category, and category_name params if using include
138           $category = '';
139           $category_name = '';
140           $inclinks = preg_split('/[\s,]+/',$include);
141           if ( count($inclinks) ) {
142                foreach ( $inclinks as $inclink ) {
 
Line Code
226      $query .= " ORDER BY $orderby $order";
227      if ($limit != -1)
228           $query .= " LIMIT $limit";
229
230      $results = $wpdb->get_results($query);
231
232      $cache[ $key ] = $results;
233      wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
234
235      return apply_filters('get_bookmarks', $results, $r);
236 }
237
238 /**
239  * Sanitizes all bookmark fields
240  *
241  * @since 2.3
242  *
243  * @param object|array $bookmark Bookmark row
244  * @param string $context Optional, default is 'display'. How to filter the