[wp-trac] [WordPress Trac] #24674: WP_Query::is_page() should use stricter comparison

WordPress Trac noreply at wordpress.org
Wed Jul 9 08:39:22 UTC 2014


#24674: WP_Query::is_page() should use stricter comparison
--------------------------+-----------------------------
 Reporter:  clifgriffin   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Query         |     Version:  2.5
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by tobyhawkins):

 The lack of strictness also causes problems where a page title starts with
 a number. I'm working on a site that has some intro step pages that
 someone has numbered (e.g. /1-set-up-your-profile.php etc). These pages
 have an alternative header that is getting used on pages that have the
 same ID as the numbered page.


 {{{
 $test = array('1-about-us');

 if( in_array(1, $test) ) {
         // this will always be true
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24674#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list