wc_get_attribute_taxonomy_ids()
Get (cached) attribute taxonomy ID and name pairs.
No Hooks.
Return
Array
.
Usage
wc_get_attribute_taxonomy_ids();
Changelog
Since 3.6.0 | Introduced. |
wc_get_attribute_taxonomy_ids() wc get attribute taxonomy ids code WC 8.0.2
function wc_get_attribute_taxonomy_ids() { $prefix = WC_Cache_Helper::get_cache_prefix( 'woocommerce-attributes' ); $cache_key = $prefix . 'ids'; $cache_value = wp_cache_get( $cache_key, 'woocommerce-attributes' ); if ( false !== $cache_value ) { return $cache_value; } $taxonomy_ids = array_map( 'absint', wp_list_pluck( wc_get_attribute_taxonomies(), 'attribute_id', 'attribute_name' ) ); wp_cache_set( $cache_key, $taxonomy_ids, 'woocommerce-attributes' ); return $taxonomy_ids; }