wc_get_order_status_name

Get the nice name for an order status.

Description

(string) wc_get_order_status_name( (string) $status ); 

Returns (string)

Parameters (1)

0. $status (string)
The status.

Usage

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

Defined (1)

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

/includes/wc-order-functions.php  
  1. function wc_get_order_status_name( $status ) { 
  2. $statuses = wc_get_order_statuses(); 
  3. $status = 'wc-' === substr( $status, 0, 3 ) ? substr( $status, 3 ) : $status; 
  4. $status = isset( $statuses[ 'wc-' . $status ] ) ? $statuses[ 'wc-' . $status ] : $status; 
  5. return $status;