WordPress at Your Fingertips
function is not described

WC_Post_Data::delete_order_items() public WC 1.0

Remove item meta on permanent deletion.

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

Return

null. Nothing.

Usage

$result = WC_Post_Data::delete_order_items( $postid );
$postid(int) (required)
Post ID.

Code of WC_Post_Data::delete_order_items() WC 5.7.1

public static function delete_order_items( $postid ) {
	global $wpdb;

	if ( in_array( get_post_type( $postid ), wc_get_order_types(), true ) ) {
		do_action( 'woocommerce_delete_order_items', $postid );

		$wpdb->query(
			"
			DELETE {$wpdb->prefix}woocommerce_order_items, {$wpdb->prefix}woocommerce_order_itemmeta
			FROM {$wpdb->prefix}woocommerce_order_items
			JOIN {$wpdb->prefix}woocommerce_order_itemmeta ON {$wpdb->prefix}woocommerce_order_items.order_item_id = {$wpdb->prefix}woocommerce_order_itemmeta.order_item_id
			WHERE {$wpdb->prefix}woocommerce_order_items.order_id = '{$postid}';
			"
		); // WPCS: unprepared SQL ok.

		do_action( 'woocommerce_deleted_order_items', $postid );
	}
}