[wp-trac] [WordPress Trac] #12647: $wp_query doesn't report the full pagename

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 19 14:39:42 UTC 2010


#12647: $wp_query doesn't report the full pagename
--------------------------+-------------------------------------------------
 Reporter:  dphiffer      |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:            
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 I've just discovered a bug in my JSON API plugin where it is unable to
 introspect on sub-pages. Instead of getting the page's data in JSON format
 (as you do for pages at the root level), the API returns the same response
 as if you had requested a non-existent page. Consider the following:

 $pagename = get_query_var('pagename');
 query_posts("pagename=$pagename");

 If you run that code against a path like "/page/subpage/" you will get a
 404. In this case the value of $pagename from the first line is going to
 be 'subpage', but the query_posts pagename parameter is expecting a full
 path like 'page/subpage'.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12647>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list