WC_Product_Attribute::offsetGet()publicWC 1.0ReturnTypeWillChange

OffsetGet.

Метод класса: WC_Product_Attribute{}

Хуков нет.

Возвращает

Разное.

Использование

$WC_Product_Attribute = new WC_Product_Attribute();
$WC_Product_Attribute->offsetGet( $offset );
$offset(строка) (обязательный)
Offset.

Код WC_Product_Attribute::offsetGet() WC 8.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"}();
			}
			break;
	}
	return '';
}