Elementor custom taxonomy select

function elementor_custom_taxonomy_list( ) {
	$taxonomy_name = 'taxonomy_name';
	$elements = get_terms( $taxonomy_name, array('hide_empty' => false) );
	$cpt_cat_array = array();

	if ( !empty($elements) ) {
		foreach ( $elements as $element ) {
			$info = get_term($element, $taxonomy_name);
			$cpt_cat_array[ $info->term_id ] = $info->name;
		}
	}

	return $cpt_cat_array;
}

Leave a Reply