Skip to content

Instantly share code, notes, and snippets.

@shaddam
Created November 18, 2019 03:43
Show Gist options
  • Select an option

  • Save shaddam/396b64e515dd8cfd514401070799e912 to your computer and use it in GitHub Desktop.

Select an option

Save shaddam/396b64e515dd8cfd514401070799e912 to your computer and use it in GitHub Desktop.
Get Taxonomy List in WP for elementor addons
/*
* Get Taxonomy
* return array
*/
function themename_get_taxonomies( $themename_texonomy = 'category' ){
$terms = get_terms( array(
'taxonomy' => $themename_texonomy,
'hide_empty' => true,
));
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
$options[ $term->slug ] = $term->name;
}
return $options;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment