ACF\AI\GEO
Schema::get_type_parents
Get all parent types for a given type
Метод класса: Schema{}
Хуков нет.
Возвращает
array. Array of parent type names in order from direct parent to root
Использование
$result = Schema::get_type_parents( $type );
- $type(строка) (обязательный)
- The schema.org type name.
Список изменений
| С версии 6.8.0 | Введена. |
Код Schema::get_type_parents() Schema::get type parents ACF 6.8.11
private static function get_type_parents( $type ) {
$parents = array();
$current = $type;
$type_hierarchy = SchemaData::get_type_hierarchy();
while ( isset( $type_hierarchy[ $current ] ) ) {
$parent = $type_hierarchy[ $current ];
$parents[] = $parent;
$current = $parent;
}
return $parents;
}