__('All', 'acf') ), $choices); } /** * rule_match * * @param $match * @param $rule * @param $options * * @return bool */ function rule_match($match, $rule, $options){ // rule value might be empty // in case a field group use a custom location type from third party plugin // if the third party plugin is disabled, acf will fallback to "Post Type == ''" // and pass thru this rule because it's the first one if(empty($rule['value'])){ return $match; } if($rule['value'] !== 'all'){ return $match; } if(!acfe_get($options, 'post_type')){ return $match; } $post_types = acf_get_post_types(); $match = in_array($options['post_type'], $post_types); if($rule['operator'] === '!='){ $match = !$match; } return $match; } } acf_new_instance('acfe_location_post_type_all'); endif;