Function:
mp_core_get_all_tax_terms()
Purpose:
Get all taxonomy terms for ALL taxonomies. This includes, EVERY taxonomy term in existence.
Overview:
Use this function when you need to know all the terms for every taxonomy.
This function is useful if you are creating a dropdown where you would need all taxonomy terms. It can be used:
With the MP_CORE_MetaBox Class as the ‘field_select_values’ for a dropdown menu
With the MP_CORE_Settings Class as the ‘options’ for a dropdown menu
With the MP_CORE_Customizer Class as the ‘choices’ for a dropdown menu
With the MP_CORE_Widget Class as the ‘field_select_values’ for a widget
With the MP_CORE_Shortcode_Insert Class as the ‘option_value’ for a Shortcode Inserter.
Usage:
mp_core_get_all_tax_terms();
Parameters:
(array) (required) Ann array of the taxonomies that should be excluded.
Example which excludes the navigation menu taxonomy: array( ‘nav_menu’ )
Returns:
(Array)
This will return an associative array which has a key and value for each taxonomy term. They are structured like this:
array( ’12*my_category’ => ‘My Category Term’ );
The above array key is separated into 2 parts. Before the “*” is the tax term ID. After the “*” is the slug of the taxonomy that term belongs to.
The above array value is the Title of the Term.