acf_match_location_rule()ACF 5.6.0

Returns true if the provided rule matches the screen args.

Возвращает

true|false.

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

acf_match_location_rule( $rule, $screen, $field_group );
$rule(массив) (обязательный)
The location rule.
$screen(массив) (обязательный)
The screen args.
$field_group (обязательный)
-

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

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

Код acf_match_location_rule() ACF 6.0.4

function acf_match_location_rule( $rule, $screen, $field_group ) {
	$result = false;

	// Get result from location type since 5.9.
	$location_type = acf_get_location_type( $rule['param'] );
	if ( $location_type ) {
		$result = $location_type->match( $rule, $screen, $field_group );
	}

	/**
	 * Filters the result.
	 *
	 * @date    30/5/17
	 * @since   5.6.0
	 *
	 * @param   bool $result The match result.
	 * @param   array $rule The location rule.
	 * @param   array $screen The screen args.
	 * @param   array $field_group The field group array.
	 */
	$result = apply_filters( "acf/location/match_rule/type={$rule['param']}", $result, $rule, $screen, $field_group );
	$result = apply_filters( 'acf/location/match_rule', $result, $rule, $screen, $field_group );
	$result = apply_filters( "acf/location/rule_match/{$rule['param']}", $result, $rule, $screen, $field_group );
	$result = apply_filters( 'acf/location/rule_match', $result, $rule, $screen, $field_group );
	return $result;
}