wc_is_attribute_in_product_name( string $attribute, string $name )
Check if an attribute is included in the attributes area of a variation name.
Description Description
Parameters Parameters
- $attribute
-
(Required) Attribute value to check for.
- $name
-
(Required) Product name to check in.
Return Return
(bool)
Source Source
File: includes/wc-attribute-functions.php
function wc_is_attribute_in_product_name( $attribute, $name ) { $is_in_name = stristr( $name, ' ' . $attribute . ',' ) || 0 === stripos( strrev( $name ), strrev( ' ' . $attribute ) ); return apply_filters( 'woocommerce_is_attribute_in_product_name', $is_in_name, $attribute, $name ); }
Changelog Changelog
Version | Description |
---|---|
3.0.2 | Introduced. |