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

WordPress Trac noreply at wordpress.org
Mon Jul 14 00:41:55 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 clifgriffin):

 Replying to [comment:16 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) ) {
 >       // true
 > }
 > }}}

 Great catch! Didn't think about that scenario.

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


More information about the wp-trac mailing list