pre_get_users WordPress Action Hook

The pre_get_users hook is a great way to modify the user query before it is executed. This can be useful for things like adding custom fields to the user query or changing the order of the results.

do_action_ref_array( 'pre_get_users', WP_User_Query $query ) #

Fires before the WP_User_Query has been parsed.


Description

The passed WP_User_Query object contains the query variables, not yet passed into SQL.


Top ↑

Parameters

$query

(WP_User_Query)Current instance of WP_User_Query (passed by reference).


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.0.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.