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.


Top ↑

Return Return

(bool)


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.2 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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