Created
November 18, 2019 03:43
-
-
Save shaddam/396b64e515dd8cfd514401070799e912 to your computer and use it in GitHub Desktop.
Get Taxonomy List in WP for elementor addons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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