acf_get_location_rule_operators()ACF 5.6.0

Returns an array of operators for a given rule.

Возвращает

Массив.

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

acf_get_location_rule_operators( $rule );
$rule(массив) (обязательный)
The location rule.

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

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

Код acf_get_location_rule_operators() ACF 6.0.4

function acf_get_location_rule_operators( $rule ) {
	$operators = ACF_Location::get_operators( $rule );

	// Get operators from location type since 5.9.
	$location_type = acf_get_location_type( $rule['param'] );
	if ( $location_type ) {
		$operators = $location_type->get_operators( $rule );
	}

	/**
	 * Filters the location rule operators.
	 *
	 * @date    30/5/17
	 * @since   5.6.0
	 *
	 * @param   array $types The location rule operators.
	 */
	$operators = apply_filters( "acf/location/rule_operators/type={$rule['param']}", $operators, $rule );
	$operators = apply_filters( "acf/location/rule_operators/{$rule['param']}", $operators, $rule );
	$operators = apply_filters( 'acf/location/rule_operators', $operators, $rule );
	return $operators;
}