[wp-trac] [WordPress Trac] #11373: get_page_by_path() enhancements
WordPress Trac
wp-trac at lists.automattic.com
Sun Jun 13 01:32:26 UTC 2010
#11373: get_page_by_path() enhancements
-------------------------------+--------------------------------------------
Reporter: Denis-de-Bernardy | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: 3.1
Component: Cache | Version: 2.9
Severity: normal | Keywords: early has-patch commit
-------------------------------+--------------------------------------------
Changes (by shidouhikari):
* cc: shidouhikari (added)
Comment:
Replying to [comment:3 dd32]:
> Is there any good reason why get_page() or get_post() couldnt be used
inside that loop to take care of the query & caching?
get_page() is used below, when desired page is found. While it's not
found, database is queried inside 2 TWO loops over and over again
searching for the desired page. And when that's the case, all we need is
post_parent, post_name and ID.
If that post is in cache, there's no need to query database, just get it
from cache and move on. Faster and secure. I vote for this patch to be
commited :)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11373#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list