WC_Abstract_Legacy_Product::__isset() public WC 1.0
Magic __isset method for backwards compatibility. Legacy properties which could be accessed directly in the past.
{} 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->__isset( $key );
- $key(string) (required)
- Key name.
Code of WC_Abstract_Legacy_Product::__isset() WC Abstract Legacy Product:: isset WC 5.0.0
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 );
}