WordPress.org

Make WordPress Core

Opened 2 years ago

#40949 new defect (bug)

wp_dropdown_users($args) is not returning desired list of users

Reported by: subrataemfluence Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.5
Component: Users Keywords:
Focuses: Cc:
PR Number:

Description

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
$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.

Change History (0)

Note: See TracTickets for help on using tickets.