WC_Product_Attribute::offsetGet( string $offset )
OffsetGet.
Description Description
Parameters Parameters
- $offset
-
(Required) Offset.
Return Return
(mixed)
Source Source
File: includes/class-wc-product-attribute.php
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"}();
}
break;
}
return '';
}