woocommerce_register_shipping_method

Register a shipping method.

Description

woocommerce_register_shipping_method( (string|object) $shipping_method ); 

Parameters (1)

0. $shipping_method (string|object)
Class name (string) or a class object.

Usage

  1. if ( !function_exists( 'woocommerce_register_shipping_method' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4. // class name (string) or a class object. 
  5. $shipping_method = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = woocommerce_register_shipping_method($shipping_method); 
  9.  

Defined (1)

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

/includes/wc-core-functions.php  
  1. function woocommerce_register_shipping_method( $shipping_method ) { 
  2. WC()->shipping->register_shipping_method( $shipping_method );