BP_XProfile_Query::__construct( array $xprofile_query )

Constructor.

Description

Parameters

$xprofile_query

(array) (Required) Array of xprofile query clauses.

  • 'relation'
    (string) Optional. The MySQL keyword used to join the clauses of the query. Accepts 'AND', or 'OR'. Default 'AND'.
  • (array) Optional. An array of first-order clause parameters, or another fully-formed xprofile query.
    • 'field'
      (string|int) XProfile field to filter by. Accepts a field name or ID.
    • 'value'
      (string) XProfile value to filter by.
    • 'compare'
      (string) MySQL operator used for comparing the $value. Accepts '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', or 'RLIKE'. Default is 'IN' when $value is an array, '=' otherwise.
    • 'type'
      (string) MySQL data type that the value column will be CAST to for comparisons. Accepts 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', or 'UNSIGNED'. Default is 'CHAR'.

Source

File: bp-xprofile/classes/class-bp-xprofile-query.php

	public function __construct( $xprofile_query ) {
		if ( empty( $xprofile_query ) ) {
			return;
		}

		$this->queries = $this->sanitize_query( $xprofile_query );
	}

Changelog

Changelog
Version Description
BuddyPress 2.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.