WC_Product_Importer::get_existing_attribute_taxonomy_id │ protected │ WC 11.1.0

Get the ID of an existing global attribute taxonomy, without creating it when it is missing.

Method of the class: WC_Product_Importer{}

No Hooks.

Returns

int. Attribute taxonomy ID, or 0 when no such global attribute exists.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_existing_attribute_taxonomy_id( $raw_name );
$raw_name(string) (required)
Attribute name or label.

Changelog

Since 11.1.0 Introduced.

WC_Product_Importer::get_existing_attribute_taxonomy_id() code WC 11.1.2

protected function get_existing_attribute_taxonomy_id( $raw_name ) {
	return (int) wc_attribute_taxonomy_id_by_name( $this->get_attribute_taxonomy_name_from_raw_name( $raw_name ) );
}