[wp-trac] [WordPress Trac] #18114: is_home erroneously returns true for nav menu queries

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 14 14:52:24 UTC 2011


#18114: is_home erroneously returns true for nav menu queries
--------------------------+-----------------------------
 Reporter:  batmoo        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  3.2
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 The main query generated by {{{wp_nav_menu}}} has the {{{is_home}}}
 property set to true. This seems like a bug and makes it difficult to
 modify is_home-only queries.

 Quick test:

 {{{
 function nav_menu_test( $query ) {
         if ( 'nav_menu_item' == $query->get( 'post_type' ) )
                 var_dump( $query->is_home );
 }

 add_action( 'pre_get_posts', 'nav_menu_test' );
 }}}

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


More information about the wp-trac mailing list