[wp-trac] [WordPress Trac] #17662: PHP Notices in get_body_class() for certain query conditions

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 21 15:24:32 UTC 2011


#17662: PHP Notices in get_body_class() for certain query conditions
--------------------------+------------------------------
 Reporter:  dd32          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  3.2
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by mfields):

 I think that the best solution to this might be to extend
 get_queried_object() to accept a parameter for "type". This way we can
 specify which queried object is returned in a multiple object query. We
 would be able to do get_queried_object( 'author' ) or get_queried_object(
 'category' ). Perhaps a new function could be created named
 get_queried_objects() That would return an array of all objects returned
 by the query. Not sure what to do with get_queried_object_id() though.
 Perhaps it could always return the ID of the first object in the array
 returned by get_queried_objects(). Care could be taken to ensure that the
 first object in this array would always represent the item WordPress now
 sees as the queried object.

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


More information about the wp-trac mailing list