Changeset 34804 for trunk/src/wp-includes/class-wp-user-query.php
- Timestamp:
- 10/03/2015 06:44:40 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-user-query.php
r34531 r34804 74 74 $this->query(); 75 75 } 76 } 77 78 /** 79 * Fills in missing query variables with default values. 80 * 81 * @since 4.4.0 82 * @access public 83 * 84 * @param array $args Query vars, as passed to `WP_User_Query`. 85 * @return array Complete query variables with undefined ones filled in with defaults. 86 */ 87 public static function fill_query_vars( $args ) { 88 $defaults = array( 89 'blog_id' => $GLOBALS['blog_id'], 90 'role' => '', 91 'meta_key' => '', 92 'meta_value' => '', 93 'meta_compare' => '', 94 'include' => array(), 95 'exclude' => array(), 96 'search' => '', 97 'search_columns' => array(), 98 'orderby' => 'login', 99 'order' => 'ASC', 100 'offset' => '', 101 'number' => '', 102 'paged' => 1, 103 'count_total' => true, 104 'fields' => 'all', 105 'who' => '', 106 'has_published_posts' => null, 107 ); 108 109 return wp_parse_args( $args, $defaults ); 76 110 } 77 111 … … 147 181 if ( empty( $this->query_vars ) || ! empty( $query ) ) { 148 182 $this->query_limit = null; 149 $this->query_vars = wp_parse_args( $query, array( 150 'blog_id' => $GLOBALS['blog_id'], 151 'role' => '', 152 'meta_key' => '', 153 'meta_value' => '', 154 'meta_compare' => '', 155 'include' => array(), 156 'exclude' => array(), 157 'search' => '', 158 'search_columns' => array(), 159 'orderby' => 'login', 160 'order' => 'ASC', 161 'offset' => '', 162 'number' => '', 163 'paged' => 1, 164 'count_total' => true, 165 'fields' => 'all', 166 'who' => '', 167 'has_published_posts' => null, 168 ) ); 183 $this->query_vars = $this->fill_query_vars( $query ); 169 184 } 170 185 … … 182 197 do_action( 'pre_get_users', $this ); 183 198 199 // Ensure that query vars are filled after 'pre_get_users'. 184 200 $qv =& $this->query_vars; 201 $qv = $this->fill_query_vars( $qv ); 185 202 186 203 if ( is_array( $qv['fields'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.