WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Order::get_item_meta_array() public WC 1.0

Get all item meta data in array format in the order it was saved. Does not group meta by key like get_item_meta().

{} It's a method of the class: WC_Abstract_Legacy_Order{}

No Hooks.


Array. of objects


$WC_Abstract_Legacy_Order = new WC_Abstract_Legacy_Order();
$WC_Abstract_Legacy_Order->get_item_meta_array( $order_item_id );
$order_item_id(mixed) (required)

Code of WC_Abstract_Legacy_Order::get_item_meta_array() WC 5.7.1

public function get_item_meta_array( $order_item_id ) {
	wc_deprecated_function( 'WC_Order::get_item_meta_array', '3.0', 'WC_Order_Item::get_meta_data() (note the format has changed)' );
	$item            = $this->get_item( $order_item_id );
	$meta_data       = $item->get_meta_data();
	$item_meta_array = array();

	foreach ( $meta_data as $meta ) {
		$item_meta_array[ $meta->id ] = $meta;

	return $item_meta_array;