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
114           'exclude' => '', 'search' => ''
115      );
116
117      $r = wp_parse_args( $args, $defaults );
118      extract( $r, EXTR_SKIP );
119
120      $key = md5( serialize( $r ) );
121      if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
122           if ( isset( $cache[ $key ] ) )
123                return apply_filters('get_bookmarks', $cache[ $key ], $r );
124
125      $inclusions = '';
126      if ( !empty($include) ) {
127           $exclude = '';  //ignore exclude, category, and category_name params if using include
128           $category = '';
129           $category_name = '';
130           $inclinks = preg_split('/[\s,]+/',$include);
131           if ( count($inclinks) ) {
132                foreach ( $inclinks as $inclink ) {
 
Line Code
216      $query .= " ORDER BY $orderby $order";
217      if ($limit != -1)
218           $query .= " LIMIT $limit";
219
220      $results = $wpdb->get_results($query);
221
222      $cache[ $key ] = $results;
223      wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
224
225      return apply_filters('get_bookmarks', $results, $r);
226 }
227
228 /**
229  * sanitize_bookmark() - Sanitizes all bookmark fields
230  *
231  * @since 2.3
232  *
233  * @param object|array $bookmark Bookmark row
234  * @param string $context Optional, default is 'display'. How to filter the fields