is_taxonomy_hierarchical()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
is_taxonomy_hierarchical( string $taxonomy ): bool
Описание
Сначала убеждается, что таксономия является объектом. Затем получает объект и, наконец, возвращает значение hierarchical из этого объекта.
Возврат false может также означать, что таксономия не существует.
Подробнее об этой и похожих функциях тем можно узнать в статье о Conditional Tags в Theme Developer Handbook.
Оригинал (английский)
Checks to make sure that the taxonomy is an object first. Then Gets the object, and finally returns the hierarchical value in the object.
A false return value might also mean that the taxonomy does not exist.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Параметры
$taxonomy
string
обязательный
Возвращаемое значение
bool
Исходный код
wp-includes/taxonomy.php:399
function is_taxonomy_hierarchical( $taxonomy ) {
if ( ! taxonomy_exists( $taxonomy ) ) {
return false;
}
$taxonomy = get_taxonomy( $taxonomy );
return $taxonomy->hierarchical;
}
История изменений
| Версия | Описание |
|---|---|
| 2.3.0 | Introduced. |

