wc_is_order_status

See if a string is an order status.

Description

wc_is_order_status( (string) $maybe_status ); 

Parameters (1)

0. $maybe_status (string)
Status, including any wc- prefix

Usage

  1. if ( !function_exists( 'wc_is_order_status' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-order-functions.php'; 
  3.  
  4. // Status, including any wc- prefix 
  5. $maybe_status = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_is_order_status($maybe_status); 
  9.  

Defined (1)

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

/includes/wc-order-functions.php  
  1. function wc_is_order_status( $maybe_status ) { 
  2. $order_statuses = wc_get_order_statuses(); 
  3. return isset( $order_statuses[ $maybe_status ] );