Title: wp_dropdown_users_args
Published: December 9, 2015
Last modified: February 24, 2026

---

# apply_filters( ‘wp_dropdown_users_args’, array $query_args, array $parsed_args )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#wp--skip-link--target)

Filters the query arguments for the list of users in the dropdown.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#parameters)󠁿

 `$query_args`array

The query arguments for [get_users()](https://developer.wordpress.org/reference/functions/get_users/).

More Arguments from get_users( … $args )

Arguments to retrieve users. See [WP_User_Query::prepare_query()](https://developer.wordpress.org/reference/classes/wp_user_query/prepare_query/)
for more information on accepted arguments.

`$parsed_args`array

The arguments passed to [wp_dropdown_users()](https://developer.wordpress.org/reference/functions/wp_dropdown_users/)
combined with the defaults.

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()](https://developer.wordpress.org/reference/classes/wp_user_query/prepare_query/)
for additional available arguments.

 * `show_option_all` string
 * Text to show as the drop-down default (all).
    Default empty.
 * `show_option_none` string
 * Text to show as the drop-down default when no users were found. Default empty.
 * `option_none_value` int|string
 * Value to use for `$show_option_none` when no users were found. Default -1.
 * `hide_if_only_one_author` string
 * Whether to skip generating the drop-down if only one user was found. Default 
   empty.
 * `orderby` string
 * Field to order found users by. Accepts user fields.
    Default `'display_name'`.
 * `order` string
 * Whether to order users in ascending or descending order. Accepts `'ASC'` (ascending)
   or `'DESC'` (descending).
    Default `'ASC'`.
 * `include` int[]|string
 * Array or comma-separated list of user IDs to include.
    Default empty.
 * `exclude` int[]|string
 * Array or comma-separated list of user IDs to exclude.
    Default empty.
 * `multi` bool|int
 * Whether to skip the ID attribute on the `'select'` element.
    Accepts `1|true`
   or `0|false`. Default `0|false`.
 * `show` string
 * 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. Default `'display_name'`.
 * `echo` int|bool
 * Whether to echo or return the drop-down. Accepts `1|true` (echo) or `0|false`(
   return). Default `1|true`.
 * `selected` int
 * Which user ID should be selected. Default 0.
 * `include_selected` bool
 * Whether to always include the selected user ID in the drop- down. Default false.
 * `name` string
 * Name attribute of select element. Default `'user'`.
 * `id` string
 * ID attribute of the select element. Default is the value of `$name`.
 * `class` string
 * Class attribute of the select element. Default empty.
 * `blog_id` int
 * ID of blog (Multisite only). Default is ID of the current blog.
 * `who` string
 * Deprecated, 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. Default empty.
 * `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'](https://developer.wordpress.org/reference/hooks/map_meta_cap/).
   Default empty.
 * `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'](https://developer.wordpress.org/reference/hooks/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'](https://developer.wordpress.org/reference/hooks/map_meta_cap/).
   Default empty array.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#source)󠁿

    ```php
    $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $parsed_args );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/user.php#L1792)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/user.php#L1792-L1792)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_dropdown_users()](https://developer.wordpress.org/reference/functions/wp_dropdown_users/)`wp-includes/user.php` |

Creates dropdown HTML content of users.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 6 content](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#comment-content-1024)
 2.    [Jonathan Goldford](https://profiles.wordpress.org/jg-visual/)  [  10 years ago  ](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-1024)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-1024)
     Vote results for this note: 4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-1024)
 4.  This filter allows you to set subscribers as authors of blog posts within the 
     admin without giving them additional privileges. Here’s the code:
 5.      ```php
         add_filter( 'wp_dropdown_users_args', 'wpdocs_add_subscribers_to_dropdown' );
         function wpdocs_add_subscribers_to_dropdown( $query_args ) {
     
             $query_args['who'] = '';
             return $query_args;
     
         }
         ```
     
 6.   * I’ve been using this for a while and it was working well for both filtering
        by Author and Batch Editing post and assigning them to subscribers. However
        batch editing now only shows Admin users.
      * [edouardflowasia](https://profiles.wordpress.org/edouardflowasia/) [4 years ago](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-6134)
      * It seems like this code is not displaying subscribers in the dropdown anymore.
      * Anonymous User [3 years ago](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-6394)
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%3Freplytocom%3D1024%23feedback-editor-1024)
 8.   [Skip to note 7 content](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#comment-content-1607)
 9.    [RiseOfLex88](https://profiles.wordpress.org/riseoflex88/)  [  10 years ago  ](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-1607)
 10. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-1607)
     Vote results for this note: 4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-1607)
 11. In addition to Jonathan’s contribution, you can also expand it further by specifying
     the role. This is undocumented on wp codex. But does work e.g.
 12.     ```php
         function wpdocs_add_subscribers_to_dropdown( $query_args, $r ) {
     
         	$query_args['role'] = array('contributor');
     
         	// Unset the 'who' as this defaults to the 'author' role
         	unset( $query_args['who'] );
     
         	return $query_args;
         }
         add_filter( 'wp_dropdown_users_args', 'wpdocs_add_subscribers_to_dropdown', 10, 2 );
         ```
     
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%3Freplytocom%3D1607%23feedback-editor-1607)
 14.  [Skip to note 8 content](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#comment-content-4087)
 15.   [pgDarkness](https://profiles.wordpress.org/pgdarkness/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-4087)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-4087)
     Vote results for this note: 3[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-4087)
 17. In addition to RiseOfLex88’s contribution, you can also specify multiple roles.
 18.     ```php
         function wpdocs_add_subscribers_to_dropdown( $query_args ) {
     
         	// Use this array to specify multiple roles to show in dropdown
             $query_args['role__in'] = array( 'contributor', 'administrator' );
     
         	// Use this array to specify multiple roles to hide in dropdown
             $query_args['role__not_in'] = array( 'editor' );
     
             // Unset the 'who' as this defaults to the 'author' role
             unset( $query_args['who'] );
     
             return $query_args;
         }
         add_filter( 'wp_dropdown_users_args', 'wpdocs_add_subscribers_to_dropdown' );
         ```
     
 19. If you dump variable “$query_args” inside this function, this is what you will
     get:
 20.     ```php
         array(10) { 
           ["blog_id"]=&gt; int(1) 
           ["include"]=&gt; string(0) "" 
           ["exclude"]=&gt; string(0) "" 
           ["orderby"]=&gt; string(12) "display_name" 
           ["order"]=&gt; string(3) "ASC" 
           ["who"]=&gt; string(7) "authors" 
           ["role"]=&gt; string(0) "" 
           ["role__in"]=&gt; array(0) { } 
           ["role__not_in"]=&gt; array(0) { } 
           ["fields"]=&gt; array(3) { 
             [0]=&gt; string(2) "ID" 
             [1]=&gt; string(10) "user_login" 
             [2]=&gt; string(12) "display_name" 
           } 
         }
         ```
     
 21.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%3Freplytocom%3D4087%23feedback-editor-4087)
 22.  [Skip to note 9 content](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#comment-content-6209)
 23.   [Sarah Lewis](https://profiles.wordpress.org/bookchiq/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-6209)
 24. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-6209)
     Vote results for this note: 3[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-6209)
 25. Note that if you’re trying to filter the “Author” dropdown on the post editor 
     screen, and the post editor is using Gutenberg, this filter doesn’t fire. You’ll
     need to work with the [rest_user_query](https://developer.wordpress.org/reference/hooks/rest_user_query/)
     filter instead. (But also note that this filter is used for a lot more than the
     Author dropdown, so use it thoughtfully.)
 26.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%3Freplytocom%3D6209%23feedback-editor-6209)
 27.  [Skip to note 10 content](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/?output_format=md#comment-content-6924)
 28.   [JamesKoussertari](https://profiles.wordpress.org/jameskoussertari/)  [  2 years ago  ](https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/#comment-6924)
 29. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-6924)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%23comment-6924)
 30. For this to work with Subscribers, you’ll also need to adjust the capability:
 31.     ```php
         // Show Subscribers in the 'author' drop down on the classic post editor
         function wpdocs_add_subscribers_to_dropdown( $query_args ) {
             $query_args['who'] = ''; // reset the query
             $query_args['capability'] = ''; // reset the query
             $query_args['role__in'] = array( 'administrator', 'subscriber', 'author', 'editor' );
             $query_args['capability__in'] = array( 'edit_own_posts' ); // Custom capability for subscribers
     
             return $query_args;
         }
         add_filter( 'wp_dropdown_users_args', 'wpdocs_add_subscribers_to_dropdown' );
         ```
     
 32.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F%3Freplytocom%3D6924%23feedback-editor-6924)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_dropdown_users_args%2F)
before being able to contribute a note or feedback.