[wp-trac] [WordPress Trac] #40949: wp_dropdown_users($args) is not returning desired list of users

WordPress Trac noreply at wordpress.org
Thu Jun 8 14:38:08 UTC 2017


#40949: wp_dropdown_users($args) is not returning desired list of users
------------------------------+-----------------------------
 Reporter:  subrataemfluence  |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Users             |    Version:  4.7.5
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 Below is a list of users with their roles:


 {{{
 aniket: Subscriber, Participant
 cjx2009: Editor, Participant
 jackoliv: Author, Participant
 creamy90: Editor, Participant
 lalitgarg: Participant
 warrior: Contributor, Moderator
 }}}


 Here is the $args array:


 {{{#!php
 <?php
 $args = array(
   ...
   'hide_if_only_one_author' => null,
   'role' => array('Subscriber', 'Participant'),
   'role__in => array('Editor', 'Contributor'),
   'role__not_in => null
 );
 }}}

 When calling `wp_dropdown_users` i don't see any dropdown list.
 While, according to above users and their respective roles the list should
 bring up the following users:

 {{{
 aniket (matches exactly with 'role': Subscriber, Participant)
 cjx2009 (matches 'role__in': Editor)
 warrior (matches 'role__in': Contributor)
 }}}


 Even if I do not use a combination like above and just use `role =>
 array('Subscriber', 'Participant')` nothing appears (I already have
 `'hide_if_only_one_author' => null,`).

 Furthermore, if I set `role => null` and use `role__in =>
 array('Contributor', 'Moderator')`, again there is nothing when I am
 expecting user `warrior` will come up in  dropdown list! But if I only use
 'Contributor' the dropdown appears with `warrior`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40949>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list