WordPress.org

Make WordPress Core

Ticket #5742: wp_child_of.diff

File wp_child_of.diff, 2.0 KB (added by strider72, 6 years ago)

Adds "child_of" parameter to query_posts

  • wp-includes/query.php

     
    11891189                        $where .= ')'; 
    11901190                } 
    11911191 
     1192                $parent_page = get_query_var('child_of'); 
     1193                if (0 != $parent_page) { 
     1194                                $where .= "AND (post_parent = '$parent_page')"; 
     1195                } 
     1196 
    11921197                // Apply filters on where and join prior to paging so that any 
    11931198                // manipulations to them are reflected in the paging by day queries. 
    11941199                $where = apply_filters('posts_where', $where); 
  • wp-includes/classes.php

     
    11<?php 
    22 
    33class WP { 
    4         var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots'); 
     4        var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots','child_of'); 
    55 
    66        var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id'); 
    77        var $extra_query_vars = array();