WordPress.org

Make WordPress Core

Ticket #19867: user_dropdown_filter.diff

File user_dropdown_filter.diff, 962 bytes (added by prettyboymp, 4 years ago)
  • wp-includes/user.php

     
    977977 * 
    978978 * @since 2.3.0 
    979979 * @uses $wpdb WordPress database object for queries 
    980  * 
     980 *  
     981 * @uses apply_filters() Calls 'wp_dropdown_users_pre' with first parameter false and second 
     982 *   value $args 
     983 * @uses apply_filters() Calls 'wp_dropdown_users' with first parameter set to $output 
     984 *  
    981985 * @param string|array $args Optional. Override defaults. 
    982986 * @return string|null Null on display. String of HTML content on retrieve. 
    983987 */ 
     
    992996        ); 
    993997 
    994998        $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0; 
     999         
     1000        //allow plugins to override user dropdown before any queries are made 
     1001        if ( $out = apply_filters( 'wp_dropdown_users_pre', false, $args ) ) 
     1002                return $out; 
    9951003 
    9961004        $r = wp_parse_args( $args, $defaults ); 
    9971005        extract( $r, EXTR_SKIP );