<old_hook>

The WooCommerce old hook hook.

Description

do_action( '<old_hook>', (unknown) $order_id, (unknown) $item_id, (unknown) $item ); 

Parameters (3)

0. $order_id (unknown)
The order id.
1. $item_id (unknown)
The item id.
2. $item (unknown)
The item.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( '{$old_hook}', $order_id, $item_id, $item ); 
The following example is for adding a hook callback.
  1. // define the <old_hook> callback 
  2. function action_old_hook( $order_id, $item_id, $item ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "{$old_hook}", 'action_old_hook', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "{$old_hook}", 'action_old_hook', 10, 3 ); 

Defined (9)

The action is defined in the following location(s).

/includes/class-wc-deprecated-action-hooks.php  
  1. do_action( $old_hook, $order_id, $item_id, $item ); 
  1. do_action( $old_hook, $order_id, $item_id, $item->get_code(), $item->get_discount(), $item->get_discount_tax() ); 
  1. do_action( $old_hook, $order_id, $item_id, $item->get_rate_id(), $item->get_tax_total(), $item->get_shipping_tax_total() ); 
  1. do_action( $old_hook, $order_id, $item_id, $item->legacy_package_key ); 
  1. do_action( $old_hook, $item_id, $item->legacy_values, $item->legacy_cart_item_key ); 
  1. do_action( $old_hook, $order_id, $item_id, $item->legacy_fee, $item->legacy_fee_key ); 
  1. do_action( $old_hook, $order_id, $item_id, $item, $item->get_product() ); 
  1. do_action( $old_hook, $order_id, $item_id, $item ); 
  1. do_action_ref_array( $old_hook, $new_callback_args );