Automattic\WooCommerce\StoreApi\Schemas\V1

CartItemSchema::format_item_data_element()protectedWC 1.0

Remove HTML tags from cart item data and set the hidden property to __experimental_woocommerce_blocks_hidden.

Method of the class: CartItemSchema{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->format_item_data_element( $item_data_element );
$item_data_element(array) (required)
Individual element of a cart item data.

CartItemSchema::format_item_data_element() code WC 8.9.0

protected function format_item_data_element( $item_data_element ) {
	if ( array_key_exists( '__experimental_woocommerce_blocks_hidden', $item_data_element ) ) {
		$item_data_element['hidden'] = $item_data_element['__experimental_woocommerce_blocks_hidden'];
	}
	return array_map( 'wp_strip_all_tags', $item_data_element );
}