WC_Product_Attribute::offsetGet
OffsetGet.
Method of the class: WC_Product_Attribute{}
No Hooks.
Returns
Mixed.
Usage
$WC_Product_Attribute = new WC_Product_Attribute(); $WC_Product_Attribute->offsetGet( $offset );
- $offset(string) (required)
- Offset.
WC_Product_Attribute::offsetGet() WC Product Attribute::offsetGet code WC 10.7.0
public function offsetGet( $offset ) {
switch ( $offset ) {
case 'is_variation':
return $this->get_variation() ? 1 : 0;
case 'is_visible':
return $this->get_visible() ? 1 : 0;
case 'is_taxonomy':
return $this->is_taxonomy() ? 1 : 0;
case 'value':
return $this->is_taxonomy() ? '' : wc_implode_text_attributes( $this->get_options() );
default:
if ( is_callable( array( $this, "get_$offset" ) ) ) {
return $this->{"get_$offset"}();
}
if ( isset( $this->extra_data[ $offset ] ) ) {
return $this->extra_data[ $offset ];
}
break;
}
return '';
}