tp TouchPointWP Utilities PersonQuery - TenthPres/TouchPoint-WP GitHub Wiki

tp\TouchPointWP\Utilities\PersonQuery

Wrap the UserQuery class such that the returned object is a Person instead of a User.


  • Full name: \tp\TouchPointWP\Utilities\PersonQuery
  • Parent class: WP_User_Query

Methods

__construct

Queries WordPress Users as Person objects.

public __construct(array $query = null, bool $forceResultToPerson = true): mixed

Parameters:

Parameter Type Description
$query array Essentially the parameters passed to WP_User_Query
$forceResultToPerson bool If true, the output from the query will always be a Person, rather than a User.

See Also:

  • \WP_User_Query::__construct

get_results

public get_results(): \tp\TouchPointWP\Utilities\PersonArray|\tp\TouchPointWP\Person[]

Return Value:

Generally, a Person array. Individual elements may be TouchPointWP_Exception objects if the person could not be found.


get_first_result

public get_first_result(): ?\tp\TouchPointWP\Person