WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Order::has_meta() public WC 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.

{} It's a 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 3.0

Code of WC_Abstract_Legacy_Order::has_meta() WC 5.7.1

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 );