WP_User_Query::fill_query_vars() WordPress Method

The WP_User_Query::fill_query_vars() method fills in the query variables, which are used in the User Query class.

WP_User_Query::fill_query_vars( array $args ) #

Fills in missing query variables with default values.


Parameters

$args

(array)(Required)Query vars, as passed to WP_User_Query.


Top ↑

Return

(array) Complete query variables with undefined ones filled in with defaults.


Top ↑

Source

File: wp-includes/class-wp-user-query.php

	public static function fill_query_vars( $args ) {
		$defaults = array(
			'blog_id'             => get_current_blog_id(),
			'role'                => '',
			'role__in'            => array(),
			'role__not_in'        => array(),
			'capability'          => '',
			'capability__in'      => array(),
			'capability__not_in'  => array(),
			'meta_key'            => '',
			'meta_value'          => '',
			'meta_compare'        => '',
			'include'             => array(),
			'exclude'             => array(),
			'search'              => '',
			'search_columns'      => array(),
			'orderby'             => 'login',
			'order'               => 'ASC',
			'offset'              => '',
			'number'              => '',
			'paged'               => 1,
			'count_total'         => true,
			'fields'              => 'all',
			'who'                 => '',
			'has_published_posts' => null,
			'nicename'            => '',
			'nicename__in'        => array(),
			'nicename__not_in'    => array(),
			'login'               => '',
			'login__in'           => array(),
			'login__not_in'       => array(),
		);

		return wp_parse_args( $args, $defaults );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.