Ticket #12945: 12945.diff
File 12945.diff, 2.1 KB (added by , 15 years ago) |
---|
-
wp-includes/post-template.php
821 821 * @param array|string $args 822 822 */ 823 823 function wp_page_menu( $args = array() ) { 824 $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '' );824 $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '', 'exclude' => implode( ',', get_pages('include_full') => false ) ); 825 825 $args = wp_parse_args( $args, $defaults ); 826 826 $args = apply_filters( 'wp_page_menu_args', $args ); 827 827 -
wp-includes/post.php
2950 2950 'meta_key' => '', 'meta_value' => '', 2951 2951 'authors' => '', 'parent' => -1, 'exclude_tree' => '', 2952 2952 'number' => '', 'offset' => 0, 2953 'post_type' => 'page', 'post_status' => 'publish', 2953 'post_type' => 'page', 'post_status' => 'publish', 'include_full' => true 2954 2954 ); 2955 2955 2956 2956 $r = wp_parse_args( $args, $defaults ); … … 3061 3061 3062 3062 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3063 3063 3064 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3064 if( $include_full ) 3065 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3066 else 3067 $query = "SELECT ID FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3065 3068 $query .= $author_query; 3066 3069 $query .= " ORDER BY " . $sort_column . " " . $sort_order ; 3067 3070 3068 3071 if ( !empty($number) ) 3069 3072 $query .= ' LIMIT ' . $offset . ',' . $number; 3070 3073 3071 $pages = $wpdb->get_results($query); 3072 3074 if( $include_full ) 3075 $pages = $wpdb->get_results( $query ); 3076 else 3077 $pages = $wpdb->get_col( $query ); 3078 3073 3079 if ( empty($pages) ) { 3074 3080 $pages = apply_filters('get_pages', array(), $r); 3075 3081 return $pages;