Filters the wp_dropdown_users() HTML output.
Parameters
$output
string- HTML output generated by wp_dropdown_users() .
More Arguments from wp_dropdown_users( … $args )
Array or string of arguments to generate a drop-down of users.
See WP_User_Query::prepare_query() for additional available arguments.
show_option_all
stringText to show as the drop-down default (all).
show_option_none
stringText to show as the drop-down default when no users were found.option_none_value
int|stringValue to use for$show_option_none
when no users were found. Default -1.hide_if_only_one_author
stringWhether to skip generating the drop-down if only one user was found.orderby
stringField to order found users by. Accepts user fields.
Default'display_name'
.order
stringWhether to order users in ascending or descending order. Accepts'ASC'
(ascending) or'DESC'
(descending).
Default'ASC'
.include
int[]|stringArray or comma-separated list of user IDs to include.
exclude
int[]|stringArray or comma-separated list of user IDs to exclude.
multi
bool|intWhether to skip the ID attribute on the'select'
element.
Accepts1|true
or0|false
. Default0|false
.show
stringUser 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.
Default'display_name'
.echo
int|boolWhether to echo or return the drop-down. Accepts1|true
(echo) or0|false
(return). Default1|true
.selected
intWhich user ID should be selected. Default 0.include_selected
boolWhether to always include the selected user ID in the drop- down. Default false.name
stringName attribute of select element. Default'user'
.id
stringID attribute of the select element. Default is the value of$name
.class
stringClass attribute of the select element.blog_id
intID of blog (Multisite only). Default is ID of the current blog.who
stringDeprecated, use$capability
instead.
Which type of users to query. Accepts only an empty string or'authors'
. Default empty (all users).role
string|string[]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
string[]An array of role names. Matched users must have at least one of these roles. Default empty array.role__not_in
string[]An array of role names to exclude. Users matching one or more of these roles will not be included in results. Default empty array.capability
string|string[]An array or a comma-separated list of capability names that users must match to be included in results. Note that this is an inclusive list: users must match *each* capability.
Does NOT work for capabilities not in the database or filtered via 'map_meta_cap'.capability__in
string[]An array of capability names. Matched users must have at least one of these capabilities.
Does NOT work for capabilities not in the database or filtered via 'map_meta_cap'. Default empty array.capability__not_in
string[]An array of capability names to exclude. Users matching one or more of these capabilities will not be included in results.
Does NOT work for capabilities not in the database or filtered via 'map_meta_cap'. Default empty array.
Source
$html = apply_filters( 'wp_dropdown_users', $output );
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.