[wp-trac] [WordPress Trac] #15063: Add a "context" property to WP_Query as a 2nd param to its constructor

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 12 00:28:09 UTC 2010


#15063: Add a "context" property to  WP_Query as a 2nd param to its constructor
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |        Owner:         
     Type:  enhancement   |       Status:  closed 
 Priority:  normal        |    Milestone:         
Component:  Post Types    |      Version:         
 Severity:  normal        |   Resolution:  wontfix
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by mikeschinkel):

 Replying to [comment:18 scribu]:
 > So, since you won't be able to assign meaningful contexts automatically
 anyway, might as well encourage plugin authors to do:
 >
 > `get_posts( array( 'post_type' => .... 'context' =>
 'my_plugin_get_those_things' ) );`
 >
 > You could then do:
 >
 > `$context = $wp_query->get('context');`
 >

 It's not really helpful unless whatever it is becomes a generally accepted
 best practice, and core implements it.

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


More information about the wp-trac mailing list