WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Product::has_all_attributes_set() public WC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Check if all variation's attributes are set.

{} It's a method of the class: WC_Abstract_Legacy_Product{}

No Hooks.

Return

true|false.

Usage

$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product();
$WC_Abstract_Legacy_Product->has_all_attributes_set();

Changelog

Deprecated 3.0.0

Code of WC_Abstract_Legacy_Product::has_all_attributes_set() WC 5.7.1

public function has_all_attributes_set() {
	wc_deprecated_function( 'WC_Product::has_all_attributes_set', '3.0', 'an array filter on get_variation_attributes for a quick solution.' );
	$set = true;

	// undefined attributes have null strings as array values
	foreach ( $this->get_variation_attributes() as $att ) {
		if ( ! $att ) {
			$set = false;
			break;
		}
	}
	return $set;
}