WC_Shipping::register_shipping_method PHP Method

register_shipping_method() public method

Register a shipping method.
public register_shipping_method ( object | string $method )
$method object | string Either the name of the method's class, or an instance of the method's class.
    public function register_shipping_method($method)
    {
        if (!is_object($method)) {
            if (!class_exists($method)) {
                return false;
            }
            $method = new $method();
        }
        if (is_null($this->shipping_methods)) {
            $this->shipping_methods = array();
        }
        $this->shipping_methods[$method->id] = $method;
    }