From 78667724490be9764b54698ebe67150a19de7854 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 29 Sep 2015 15:40:27 +0000 Subject: [PATCH] Users: Introduce the `wp_dropdown_users_args` filter, making it possible to filter the arguments for `wp_dropdown_users()` before the query is run. The 'name' argument (or the `WP_Screen` object if in the admin) can be used to help target specific instances of `wp_dropdown_users()` via this hook. Props norcross. See #19867. Built from https://develop.svn.wordpress.org/trunk@34692 git-svn-id: http://core.svn.wordpress.org/trunk@34656 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user-functions.php | 10 ++++++++++ wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index 39949bee7f..225a0bc128 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -922,6 +922,16 @@ function wp_dropdown_users( $args = '' ) { $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who' ) ); $query_args['fields'] = array( 'ID', 'user_login', $show ); + + /** + * Filter the arguments for user drop-down arguments before being passed into the query. + * + * @since 4.4.0 + * + * @param array $query_args The default arguments for wp_dropdown_users(). + */ + $query_args = apply_filters( 'wp_dropdown_users_args', $query_args ); + $users = get_users( $query_args ); $output = ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index b025fc1a05..fa23af1afc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34691'; +$wp_version = '4.4-alpha-34692'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.