[wp-trac] [WordPress Trac] #14046: WP_User constructor not working as expected if called with 2 args or its phpdoc is not clear

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 22 23:13:19 UTC 2010


#14046: WP_User constructor not working as expected if called with 2 args or its
phpdoc is not clear
-----------------------------+----------------------------------------------
 Reporter:  francescolaffi   |       Owner:                        
     Type:  defect (bug)     |      Status:  new                   
 Priority:  normal           |   Milestone:  Unassigned            
Component:  Role/Capability  |     Version:  3.0                   
 Severity:  normal           |    Keywords:  dev-feedback has-patch
-----------------------------+----------------------------------------------

Comment(by scribu):

 While working on my GSoC project, I had to refactor the WP_User_Search
 class. Here's how the constructor looks currently
 ([http://gsoc.trac.wordpress.org/browser/2010/scribu/wp-
 admin/includes/user.php?rev=417#L583 r417]):

 {{{
         function WP_User_Search($query) {
                 $this->query_vars = wp_parse_args($query, array(
                         'usersearch' => '',
                         'userpage' => 0,
                         'role' => '',
                         'orderby' => 'login',
                         'order' => 'ASC',
                         'users_per_page' => 50,
                 ));

                 ...
         }
 }}}

 I still think a get_users() function would be nice.

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


More information about the wp-trac mailing list