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