[wp-trac] [WordPress Trac] #10781: Make WP_User_Search plugin friendly

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 24 07:21:27 UTC 2010


#10781: Make WP_User_Search plugin friendly
----------------------------+-----------------------------------------------
 Reporter:  scribu          |       Owner:                 
     Type:  enhancement     |      Status:  new            
 Priority:  normal          |   Milestone:  3.0            
Component:  Administration  |     Version:  2.9            
 Severity:  normal          |    Keywords:  has-patch early
----------------------------+-----------------------------------------------
Changes (by batmoo):

 * cc: batmoo@… (added)


Comment:

 I was going to create a new ticket for this, but figured that since the
 class is being worked on, it makes sense just to bring this up here. One
 issue to watch for with the role search (which is tricky because we're
 doing a LIKE search through a serialized array). If I run the following
 code:

 {{{
 add_role('edit', 'edit');
 $u = new WP_User_Search('', '', 'edit');
 print_r($u->get_results());
 }}}

 ...it will return all users with the "Editor" role (and any user with an
 edit_* cap). It's sort of an edge case, but likely should still be patched
 (until the role system is revamped, at least). Best option I see (for now)
 is to wrap the role term in double quotes (since that's how strings vars
 in arrays seem to be serialized).

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


More information about the wp-trac mailing list