WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_User_Search::prepare_query() public WP 2.1.0

Prepares the user search query (legacy).

Это метод класса: WP_User_Search{}

Хуки из метода
Возвращает

Null. Ничего.

Использование

$WP_User_Search = new WP_User_Search();
$WP_User_Search->prepare_query();

Список изменений

С версии 2.1.0 Введена.

Код WP User Search::prepare query: wp-admin/includes/deprecated.php WP 5.5.1

<?php
public function prepare_query() {
	global $wpdb;
	$this->first_user = ($this->page - 1) * $this->users_per_page;

	$this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
	$this->query_orderby = ' ORDER BY user_login';

	$search_sql = '';
	if ( $this->search_term ) {
		$searches = array();
		$search_sql = 'AND (';
		foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
			$searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
		$search_sql .= implode(' OR ', $searches);
		$search_sql .= ')';
	}

	$this->query_from = " FROM $wpdb->users";
	$this->query_where = " WHERE 1=1 $search_sql";

	if ( $this->role ) {
		$this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
		$this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
	} elseif ( is_multisite() ) {
		$level_key = $wpdb->prefix . 'capabilities'; // WPMU site admins don't have user_levels.
		$this->query_from .= ", $wpdb->usermeta";
		$this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
	}

	do_action_ref_array( 'pre_user_search', array( &$this ) );
}