ACF\AI\GEO
Schema::is_parent_of
Check if type_a is a parent/ancestor of type_b
Метод класса: Schema{}
Хуков нет.
Возвращает
boolean. True if type_a is an ancestor of type_b
Использование
$result = Schema::is_parent_of( $type_a, $type_b );
- $type_a(строка) (обязательный)
- The potential parent type.
- $type_b(строка) (обязательный)
- The child type to check.
Список изменений
| С версии 6.8.0 | Введена. |
Код Schema::is_parent_of() Schema::is parent of ACF 6.8.11
private static function is_parent_of( $type_a, $type_b ) {
$parents = self::get_type_parents( $type_b );
return in_array( $type_a, $parents, true );
}