[wp-trac] [WordPress Trac] #21426: Add get and set methods to WP_User_Query

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 31 00:29:28 UTC 2012


#21426: Add get and set methods to WP_User_Query
----------------------------+-----------------------------
 Reporter:  wonderboymusic  |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Query           |    Version:  3.1
 Severity:  normal          |   Keywords:  has-patch
----------------------------+-----------------------------
 User queries are confusing to alter, so it would be helpful to have get
 and set methods a la WP_Query when altering WP_User_Query::query_vars in a
 filter or action.

 {{{
 do_action_ref_array( 'pre_user_query', array( &$this ) );
 }}}

 Without these methods, you have to do things like:

 {{{
 $query->query_vars[ 'meta_query' ] = array( $memory_hog );
 }}}

 Instead of:

 {{{
 $query->set( 'meta_query', array( $memory_hog )  );
 }}}

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


More information about the wp-trac mailing list