WordPress.org

Make WordPress Core

Ticket #17590: 17590.3.patch

File 17590.3.patch, 884 bytes (added by Clorith, 5 years ago)

Updated .patch to reflect recent changes to post-template.php

  • post-template.php

     
    838838 * @return string HTML content, if not displaying.
    839839 */
    840840function wp_list_pages($args = '') {
     841    global $wp_query;
     842   
    841843        $defaults = array(
    842844                'depth' => 0, 'show_date' => '',
    843845                'date_format' => get_option('date_format'),
     
    868870                if ( $r['title_li'] )
    869871                        $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
    870872
    871                 global $wp_query;
    872                 if ( is_page() || is_attachment() || $wp_query->is_posts_page )
     873                if ( is_singular() && is_post_type_hierarchical( $wp_query->get( 'post_type' ) ) || is_attachment() || $wp_query->is_posts_page )
    873874                        $current_page = $wp_query->get_queried_object_id();
    874875                $output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
    875876