wc_attribute_taxonomy_id_by_name()
Get a product attribute ID by name.
Хуков нет.
Возвращает
int.
Использование
wc_attribute_taxonomy_id_by_name( $name );
- $name(строка) (обязательный)
- Attribute name.
Список изменений
| С версии 2.6.0 | Введена. |
Код wc_attribute_taxonomy_id_by_name() wc attribute taxonomy id by name WC 10.4.2
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;
}