[wp-trac] [WordPress Trac] #17590: wp_list_pages() not setting "current_page_item" classes on custom post types

WordPress Trac wp-trac at lists.automattic.com
Fri May 27 15:41:24 UTC 2011


#17590: wp_list_pages() not setting "current_page_item" classes on custom post
types
--------------------------+-----------------------------
 Reporter:  tobiasn       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  3.1
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 wp_list_pages() don't set the correct css for a hierarchical custom post
 type.

 To reproduce this bug do this:
 <?php wp_list_pages("title_li=&post_type=custom_post_type_name"); ?>

 and compare the html output to normal pages:
 <?php wp_list_pages(); ?>

 The problem seems to be this row in wp_list_pages():
 if ( is_page() || is_attachment() || $wp_query->is_posts_page )

 In the following patch i've changed it to
 if ( is_page() || is_attachment() || $wp_query->is_posts_page ||
 ($wp_query->query_vars['post_type'] != 'post' && is_single()) )

 (If this is not the intended behavoir please let me know. )

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17590>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list