WC_Abstract_Legacy_Order::has_meta()publicWC 1.0

Deprecated from version 3.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

has_meta function for order items. This is different to the WC_Data version and should be removed in future versions.

Method of the class: WC_Abstract_Legacy_Order{}

No Hooks.


Array. of meta data.


$WC_Abstract_Legacy_Order = new WC_Abstract_Legacy_Order();
$WC_Abstract_Legacy_Order->has_meta( $order_item_id );
$order_item_id(int) (required)


Deprecated since 3.0

WC_Abstract_Legacy_Order::has_meta() code WC 8.9.0

public function has_meta( $order_item_id ) {
	global $wpdb;

	wc_deprecated_function( 'WC_Order::has_meta( $order_item_id )', '3.0', 'WC_Order_item::get_meta_data' );

	return $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value, meta_id, order_item_id
		FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d
		ORDER BY meta_id", absint( $order_item_id ) ), ARRAY_A );