woocommerce_admin_order_item_types

The WooCommerce woocommerce admin order item types hook.

Description

apply_filters( 'woocommerce_admin_order_item_types', (string) $line_item ); 

Parameters (1)

0. $line_item (string) => 'line_item'
The line item.

Usage

To run the hook, copy the example below.
  1. $line_item = apply_filters( 'woocommerce_admin_order_item_types', $line_item ); 
  2.  
  3. if ( !empty( $line_item ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_admin_order_item_types callback 
  2. function filter_woocommerce_admin_order_item_types( $line_item ) { 
  3. // make filter magic happen here... 
  4. return $line_item
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_admin_order_item_types', 'filter_woocommerce_admin_order_item_types', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_admin_order_item_types', 'filter_woocommerce_admin_order_item_types', 10, 1 ); 

Defined (1)

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

/includes/admin/meta-boxes/views/html-order-items.php  
  1. $line_items = $order->get_items( apply_filters( 'woocommerce_admin_order_item_types', 'line_item' ) );