WordPress at Your Fingertips
function is not described

WC_API_Products::get_attribute_taxonomy_by_slug() private WC 2.2

Get attribute taxonomy by slug.

{} It's a method of the class: WC_API_Products{}

No Hooks.

Return

String|null.

Usage

// private - for code of main (parent) class only
$result = $this->get_attribute_taxonomy_by_slug( $slug );
$slug(string) (required)
-

Changelog

Since 2.2 Introduced.

Code of WC_API_Products::get_attribute_taxonomy_by_slug() WC 5.7.1

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;
}