Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_pages

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
1123           'authors' => ''
1124      );
1125
1126      $r = wp_parse_args( $args, $defaults );
1127      extract( $r, EXTR_SKIP );
1128
1129      $key = md5( serialize( $r ) );
1130      if ( $cache = wp_cache_get( 'get_pages', 'page' ) )
1131           if ( isset( $cache[ $key ] ) )
1132                return apply_filters('get_pages', $cache[ $key ], $r );
1133
1134      $inclusions = '';
1135      if ( !empty($include) ) {
1136           $child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include
1137           $exclude = '';
1138           $meta_key = '';
1139           $meta_value = '';
1140           $incpages = preg_split('/[\s,]+/',$include);
1141           if ( count($incpages) ) {
 
Line Code
1206      // Update cache.
1207      update_page_cache($pages);
1208
1209      if ( $child_of || $hierarchical )
1210           $pages = & get_page_children($child_of, $pages);
1211
1212      $cache[ $key ] = $pages;
1213      wp_cache_set( 'get_pages', $cache, 'page' );
1214
1215      $pages = apply_filters('get_pages', $pages, $r);
1216
1217      return $pages;
1218 }
1219
1220 function generate_page_uri_index() {
1221      global $wpdb;
1222
1223      //get pages in order of hierarchy, i.e. children after parents
1224      $posts = get_page_hierarchy($wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page'"));