ACF_Location_Post::match
Matches the provided rule against the screen args returning a bool result.
Method of the class: ACF_Location_Post{}
No Hooks.
Returns
true|false.
Usage
$ACF_Location_Post = new ACF_Location_Post(); $ACF_Location_Post->match( $rule, $screen, $field_group );
- $rule(array) (required)
- The location rule.
- $screen(array) (required)
- The screen args.
- $field_group(array) (required)
- The field group settings.
Changelog
| Since 5.9.0 | Introduced. |
ACF_Location_Post::match() ACF Location Post::match code ACF 6.0.4
public function match( $rule, $screen, $field_group ) {
// Check screen args.
if ( isset( $screen['post_id'] ) ) {
$post_id = $screen['post_id'];
} else {
return false;
}
// Compare rule against post_id.
return $this->compare_to_rule( $post_id, $rule );
}