Make WordPress Core

Ticket #17590: 17590.2.patch

File 17590.2.patch, 913 bytes (added by SergeyBiryukov, 12 years ago)
  • wp-includes/post-template.php

     
    801801 * @return string HTML content, if not displaying.
    802802 */
    803803function wp_list_pages($args = '') {
     804        global $wp_query;
     805
    804806        $defaults = array(
    805807                'depth' => 0, 'show_date' => '',
    806808                'date_format' => get_option('date_format'),
     
    831833                if ( $r['title_li'] )
    832834                        $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
    833835
    834                 global $wp_query;
    835                 if ( is_page() || is_attachment() || $wp_query->is_posts_page )
     836                if ( is_singular() && is_post_type_hierarchical( $wp_query->get( 'post_type' ) ) || is_attachment() || $wp_query->is_posts_page )
    836837                        $current_page = $wp_query->get_queried_object_id();
    837838                $output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
    838839