ACF\AI\GEO
Schema::is_parent_of
Check if type_a is a parent/ancestor of type_b
Method of the class: Schema{}
No Hooks.
Returns
true|false. True if type_a is an ancestor of type_b
Usage
$result = Schema::is_parent_of( $type_a, $type_b );
- $type_a(string) (required)
- The potential parent type.
- $type_b(string) (required)
- The child type to check.
Changelog
| Since 6.8.0 | Introduced. |
Schema::is_parent_of() Schema::is parent of code ACF 6.8.8
private static function is_parent_of( $type_a, $type_b ) {
$parents = self::get_type_parents( $type_b );
return in_array( $type_a, $parents, true );
}