Make WordPress Core

Ticket #19867: 19867.4.diff

File 19867.4.diff, 1.2 KB (added by DrewAPicture, 9 years ago)

Add default arguments to wp_dropdown_users_args

  • src/wp-includes/user-functions.php

     
    914914
    915915        $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
    916916
    917         $r = wp_parse_args( $args, $defaults );
     917        /**
     918         * Filter the default arguments used to build a user drop-down.
     919         *
     920         * @since 4.4.0
     921         *
     922         * @param array $r The user drop-down arguments.
     923         */
     924        $r = apply_filters( 'wp_dropdown_users_args', wp_parse_args( $args, $defaults ) );
     925
    918926        $show = $r['show'];
    919927        $show_option_all = $r['show_option_all'];
    920928        $show_option_none = $r['show_option_none'];
     
    923931        $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who' ) );
    924932        $query_args['fields'] = array( 'ID', 'user_login', $show );
    925933
    926         /**
    927          * Filter the arguments for user drop-down arguments before being passed into the query.
    928          *
    929          * @since 4.4.0
    930          *
    931          * @param array $query_args The default arguments for wp_dropdown_users().
    932          */
    933         $query_args = apply_filters( 'wp_dropdown_users_args', $query_args );
    934 
    935934        $users = get_users( $query_args );
    936935
    937936        $output = '';