wc_get_order_type

Get an order type by post type name.

Description

(bool|array) wc_get_order_type( (string) $type ); 

Returns (bool|array)

of datails about the order type

Parameters (1)

0. $type (string)
Post type name

Usage

  1. if ( !function_exists( 'wc_get_order_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-order-functions.php'; 
  3.  
  4. // post type name 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_get_order_type($type); 
  9.  

Defined (1)

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

/includes/wc-order-functions.php  
  1. function wc_get_order_type( $type ) { 
  2. global $wc_order_types; 
  3.  
  4. if ( isset( $wc_order_types[ $type ] ) ) { 
  5. return $wc_order_types[ $type ]; 
  6. } else { 
  7. return false;