Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_API_Products::get_attribute_taxonomy_by_slug( string $slug )
Get attribute taxonomy by slug.
Description Description
Parameters Parameters
- $slug
-
(Required)
Return Return
(string|null)
Source Source
File: includes/legacy/api/v2/class-wc-api-products.php
private function get_attribute_taxonomy_by_slug( $slug ) { $taxonomy = null; $attribute_taxonomies = wc_get_attribute_taxonomies(); foreach ( $attribute_taxonomies as $key => $tax ) { if ( $slug == $tax->attribute_name ) { $taxonomy = 'pa_' . $tax->attribute_name; break; } } return $taxonomy; }
Changelog Changelog
Version | Description |
---|---|
2.2 | Introduced. |