Skip to content

Instantly share code, notes, and snippets.

@vladimirlukyanov
Created January 17, 2017 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladimirlukyanov/6b2c8600bffec77468789020f93b52b8 to your computer and use it in GitHub Desktop.
Save vladimirlukyanov/6b2c8600bffec77468789020f93b52b8 to your computer and use it in GitHub Desktop.
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