wp_dropdown_users

Description

The content can either be displayed, which it is by default or retrieved by setting the echo argument. The include, and exclude arguments do not need to be used; all users will be displayed in that case. Only one can be used, either include, or exclude, but not both.

The available arguments are as follows:

Returns (string)

String of HTML content.

Parameters (1)

0. $args — Optional. (string) => ''

Array or string of arguments to generate a drop-down of users. See WP_User_Query::prepare_query(…) for additional available arguments.

Whether to order users in ascending or descending order. Accepts ASC (ascending) or DESC (descending).

include(array|string) => ''

Array or comma-separated list of user IDs to include.

exclude(array|string) => ''

Array or comma-separated list of user IDs to exclude.

multi(bool|int) => 0

Whether to skip the ID attribute on the select element. Accepts 1|true or 0|false.

show(string) => 'display_name'

User data to display. If the selected item is empty then the user_login will be displayed in parentheses. Accepts any user field, or display_name_with_login to show the display name with user_login in parentheses.

echo(int|bool) => 1

Whether to echo or return the drop-down. Accepts 1|true (echo) or 0|false (return).

selected(int) => 0

Which user ID should be selected.

include_selected(bool) => false

Whether to always include the selected user ID in the drop- down.

name(string) => 'user'

Name attribute of select element.

id(string) => is the value of $name

ID attribute of the select element.

class(string) => ''

Class attribute of the select element.

blog_id(int) => is ID of the current blog

ID of blog (Multisite only).

who(string) => ''

Which type of users to query. Accepts only an empty string or authors..

role(string|array) => ''

An array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match *each* role.

role__in(array) => array()

An array of role names. Matched users must have at least one of these roles.