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
52           'exclude' => ''
53      );
54
55      $r = wp_parse_args( $args, $defaults );
56      extract( $r, EXTR_SKIP );
57
58      $key = md5( serialize( $r ) );
59      if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
60           if ( isset( $cache[ $key ] ) )
61                return apply_filters('get_bookmarks', $cache[ $key ], $r );
62
63      $inclusions = '';
64      if ( !empty($include) ) {
65      $exclude = '';  //ignore exclude, category, and category_name params if using include
66      $category = '';
67      $category_name = '';
68           $inclinks = preg_split('/[\s,]+/',$include);
69           if ( count($inclinks) ) {
70                foreach ( $inclinks as $inclink ) {
 
Line Code
151      $query .= " ORDER BY $orderby $order";
152      if ($limit != -1)
153           $query .= " LIMIT $limit";
154
155      $results = $wpdb->get_results($query);
156
157      $cache[ $key ] = $results;
158      wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
159
160      return apply_filters('get_bookmarks', $results, $r);
161 }
162
163 function sanitize_bookmark($bookmark, $context = 'display') {
164      $fields = array('link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category',
165           'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated',
166           'link_rel', 'link_notes', 'link_rss', );
167
168      $do_object = false;
169      if ( is_object($bookmark) )