WP_User_Search::__construct() WordPress Method

The WP_User_Search::__construct() method is used to instantiate a new user search object. It accepts two parameters: a WordPress database object and an array of search terms.

WP_User_Search::__construct( string $search_term = '', int $page = '', string $role = '' ) #

PHP5 Constructor – Sets up the object properties.


Parameters

$search_term

(string)(Optional)Search terms string.

Default value: ''

$page

(int)(Optional) Page ID.

Default value: ''

$role

(string)(Optional)Role name.

Default value: ''


Top ↑

Return

(WP_User_Search)


Top ↑

Source

File: wp-admin/includes/deprecated.php

	function __construct( $search_term = '', $page = '', $role = '' ) {
		_deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );

		$this->search_term = wp_unslash( $search_term );
		$this->raw_page = ( '' == $page ) ? false : (int) $page;
		$this->page = ( '' == $page ) ? 1 : (int) $page;
		$this->role = $role;

		$this->prepare_query();
		$this->query();
		$this->do_paging();
	}


Top ↑

Changelog

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

Show More