ACF_Location_Post_Type::match() public ACF 5.9.0
Matches the provided rule against the screen args returning a bool result.
{} Это метод класса: ACF_Location_Post_Type{}
Хуков нет.
Возвращает
true/false.
Использование
$ACF_Location_Post_Type = new ACF_Location_Post_Type(); $ACF_Location_Post_Type->match( $rule, $screen, $field_group );
- $rule(массив) (обязательный)
- The location rule.
- $screen(массив) (обязательный)
- The screen args.
- $field_group(массив) (обязательный)
- The field group settings.
Список изменений
С версии 5.9.0 | Введена. |
Код ACF_Location_Post_Type::match() ACF Location Post Type::match ACF 5.9.1
public function match( $rule, $screen, $field_group ) {
// Check screen args.
if( isset($screen['post_type']) ) {
$post_type = $screen['post_type'];
} elseif( isset($screen['post_id']) ) {
$post_type = get_post_type( $screen['post_id'] );
} else {
return false;
}
// Compare rule against $post_type.
return $this->compare_to_rule( $post_type, $rule );
}