WC_Shipping::register_shipping_method()
Register a shipping method.
Метод класса: WC_Shipping{}
Хуков нет.
Возвращает
true|false|null
.
Использование
$WC_Shipping = new WC_Shipping(); $WC_Shipping->register_shipping_method( $method );
- $method(объект|строка) (обязательный)
- Either the name of the method's class, or an instance of the method's class.
Код WC_Shipping::register_shipping_method() WC Shipping::register shipping method WC 9.6.1
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; }