[wp-trac] [WordPress Trac] #16802: is_page() doesn't accept a full path

WordPress Trac noreply at wordpress.org
Mon Aug 26 18:49:49 UTC 2013


#16802: is_page() doesn't accept a full path
-------------------------+------------------
 Reporter:  johnbillion  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.7
Component:  Query        |     Version:  3.1
 Severity:  minor        |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by nacin):

 Probably the best argument against this is that get_page_uri() triggers
 possibly unnecessary queries.

 If it is to happen, it should be smarter. As in, explode by `/`, first
 check the slug, then check if it has a post_parent (and if not, then it's
 not a match if the path indicates it is a child page), then check the next
 post parent, etc. Essentially, it should walk its way up the tree one by
 one and compare, rather than a get_page_uri() which could cause a few
 queries and/or cache hits.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/16802#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list