wp_dropdown_users_args

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

Description

apply_filters( 'wp_dropdown_users_args', (array) $query_args, (array) $r ); 

Parameters (2)

0. $query_args (array)
The query arguments for get_users().
1. $r (array)
The arguments passed to wp_dropdown_users() combined with the defaults.

Usage

To run the hook, copy the example below.
  1. $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $r ); 
  2.  
  3. if ( !empty( $query_args ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_dropdown_users_args callback 
  2. function filter_wp_dropdown_users_args( $query_args, $r ) { 
  3. // make filter magic happen here... 
  4. return $query_args
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_dropdown_users_args', 'filter_wp_dropdown_users_args', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_dropdown_users_args', 'filter_wp_dropdown_users_args', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/user.php  
  1. $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $r );