Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

wp_dropdown_users()

3 tags 1 category

wp_dropdown_users() — Creates dropdown HTML content of users. The content can either be displayed, which it is by default, or retrieved by setting the ‘echo’ argument to false. The ‘include’ and ‘exclude’ arguments are optional; if they are not specified, all users will be displayed. Only one can be used in a single call, either ‘include’ or ‘exclude’, but not both.

Inputs: $args (array|string): Optional. Array or string of arguments to generate a drop-down of users. See WP_User_Query::prepare_query() for additional available arguments. Field $show_option_all (string): Text to show as the drop-down default (all). Default empty. Field $show_option_none (string): Text to show as the drop-down default when no users were found. Default empty. Field $option_none_value (int|string): Value to use for $show_option_none when no users were found. Default -1. Field $hide_if_only_one_author (string): Whether to skip generating the drop-down if only one user was found. Default empty. Field $orderby (string): Field to order found users by. Accepts user fields. Default ‘display_name’. Field $order (string): Whether to order users in ascending or descending order.

Returns string: HTML dropdown list of users.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…