wc_attribute_taxonomy_id_by_name( string $name )

Get a product attribute ID by name.


Description Description


Parameters Parameters

$name

(Required) Attribute name.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/wc-attribute-functions.php

function wc_attribute_taxonomy_id_by_name( $name ) {
	$name         = wc_attribute_taxonomy_slug( $name );
	$taxonomy_ids = wc_get_attribute_taxonomy_ids();

	return isset( $taxonomy_ids[ $name ] ) ? $taxonomy_ids[ $name ] : 0;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.