acf_get_location_rule_operators()
Returns an array of operators for a given rule.
Hooks from the function
Returns
Array.
Usage
acf_get_location_rule_operators( $rule );
- $rule(array) (required)
- The location rule.
Changelog
| Since 5.6.0 | Introduced. |
acf_get_location_rule_operators() acf get location rule operators code 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;
}