У меня есть пользовательские типы сообщений в WordPress. Таможенные посты имеют таксономии.
<?php
$customQuery = new WP_Query([
'post_type' => 'custom'
]);
while ($customQuery->have_posts()) {
$customQuery->the_post();
print_r(the_taxonomies());
}
?>
Результат
Array
(
[portfolio_tag] => Taxonomies: <a href="http://localhost/wordpress/custom_tag/app/">App</a> and <a href="http://localhost/wordpress/custom_tag/developer/">Developer</a>.
)
Как получить имя всех таксономий для массива в WordPress?
Array
(
'App',
'Developer'
)