Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Get list of taxonomy names for CPT
<?php
$args = array(
'object_type' => array( 'hotels' )
);
$output = 'names'; // or objects
$operator = 'and'; // 'and' or 'or'
$taxonomies = get_taxonomies( $args, $output, $operator );
if ( $taxonomies ) {
foreach ( $taxonomies as $taxonomy ) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment