WC_Abstract_Legacy_Product::__isset()publicWC 1.0

Magic __isset method for backwards compatibility. Legacy properties which could be accessed directly in the past.

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->__isset( $key );
$key(string) (required)
Key name.

WC_Abstract_Legacy_Product::__isset() code WC 8.6.1

public function __isset( $key ) {
	$valid = array(
		'id',
		'product_attributes',
		'visibility',
		'sale_price_dates_from',
		'sale_price_dates_to',
		'post',
		'download_type',
		'product_image_gallery',
		'variation_shipping_class',
		'shipping_class',
		'total_stock',
		'crosssell_ids',
		'parent',
	);
	if ( $this->is_type( 'variation' ) ) {
		$valid = array_merge( $valid, array(
			'variation_id',
			'variation_data',
			'variation_has_stock',
			'variation_shipping_class_id',
			'variation_has_sku',
			'variation_has_length',
			'variation_has_width',
			'variation_has_height',
			'variation_has_weight',
			'variation_has_tax_class',
			'variation_has_downloadable_files',
		) );
	}
	return in_array( $key, array_merge( $valid, array_keys( $this->data ) ) ) || metadata_exists( 'post', $this->get_id(), '_' . $key ) || metadata_exists( 'post', $this->get_parent_id(), '_' . $key );
}