WordPress.org

Make WordPress Core

Ticket #7247: 7247.diff

File 7247.diff, 836 bytes (added by DD32, 7 years ago)
  • wp-includes/post.php

     
    20762078                        $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s", $meta_value); 
    20772079 
    20782080        } 
     2081 
     2082        if ( ! $hierarchical && $child_of > 0 ) 
     2083                $where .= $wpdb->prepare(' AND post_parent = %d ', $child_of); 
     2084 
    20792085        $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where "; 
    20802086        $query .= $author_query; 
    20812087        $query .= " ORDER BY " . $sort_column . " " . $sort_order ; 
     
    20882094        // Update cache. 
    20892095        update_page_cache($pages); 
    20902096 
    2091         if ( $child_of || $hierarchical ) 
     2097        if ( $hierarchical ) 
    20922098                $pages = & get_page_children($child_of, $pages); 
    20932099 
    20942100        $cache[ $key ] = $pages;