WC_Order_Item::offsetExists
OffsetExists for ArrayAccess.
Method of the class: WC_Order_Item{}
No Hooks.
Returns
true|false.
Usage
$WC_Order_Item = new WC_Order_Item(); $WC_Order_Item->offsetExists( $offset );
- $offset(string) (required)
- Offset.
WC_Order_Item::offsetExists() WC Order Item::offsetExists code WC 10.5.0
public function offsetExists( $offset ) {
$this->maybe_read_meta_data();
if ( 'item_meta_array' === $offset || 'item_meta' === $offset || array_key_exists( $offset, $this->data ) ) {
return true;
}
return array_key_exists( $offset, wp_list_pluck( $this->meta_data, 'value', 'key' ) ) || array_key_exists( '_' . $offset, wp_list_pluck( $this->meta_data, 'value', 'key' ) );
}