WordPress at Your Fingertips
function is not described

WC_Shipping::register_shipping_method() public WC 1.0

Register a shipping method.

{} It's a method of the class: WC_Shipping{}

No Hooks.

Return

true|false|null.

Usage

$WC_Shipping = new WC_Shipping();
$WC_Shipping->register_shipping_method( $method );
$method(object|string) (required)
Either the name of the method's class, or an instance of the method's class.

Code of WC_Shipping::register_shipping_method() WC 5.9.0

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;
}