[wp-trac] Re: [WordPress Trac] #5430: Change is_page() to accept array as argument

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 6 23:53:47 GMT 2007


#5430: Change is_page() to accept array as argument
-------------------------+--------------------------------------------------
 Reporter:  azaozz       |        Owner:  anonymous
     Type:  enhancement  |       Status:  new      
 Priority:  normal       |    Milestone:  2.5      
Component:  Template     |      Version:           
 Severity:  normal       |   Resolution:           
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by azaozz):

 The attachment didn't come up as expected, sry. Here's the change
 line 155 in query.php, instead of:
 {{{
 if ( $page == $page_obj->ID )
     return true;
 elseif ( $page == $page_obj->post_title )
     return true;
 else if ( $page == $page_obj->post_name )
     return true;
 }}}

 add:

 {{{
 $page = (array) $page;

 if ( in_array( $page_obj->ID, $page ) )
     return true;
 elseif ( in_array( $page_obj->post_title, $page ) )
     return true;
 elseif ( in_array( $page_obj->post_name, $page ) )
     return true;
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5430#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list