WC_Shipping_Method::get_option()
Get_option function.
Gets an option from the settings API, using defaults if necessary to prevent undefined notices.
Метод класса: WC_Shipping_Method{}
Хуки из метода
Возвращает
Разное
. The value specified for the option or a default value for the option.
Использование
$WC_Shipping_Method = new WC_Shipping_Method(); $WC_Shipping_Method->get_option( $key, $empty_value );
- $key(строка) (обязательный)
- Key.
- $empty_value(разное)
- Empty value.
По умолчанию: null
Код WC_Shipping_Method::get_option() WC Shipping Method::get option WC 9.7.1
public function get_option( $key, $empty_value = null ) { // Instance options take priority over global options. if ( $this->instance_id && array_key_exists( $key, $this->get_instance_form_fields() ) ) { return $this->get_instance_option( $key, $empty_value ); } // Return global option. $option = apply_filters( 'woocommerce_shipping_' . $this->id . '_option', parent::get_option( $key, $empty_value ), $key, $this ); return $option; }