WordPress at Your Fingertips
function is not described

WC_Shipping_Method::get_instance_option() public WC 1.0

Gets an option from the settings API, using defaults if necessary to prevent undefined notices.

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

Return

Mixed. The value specified for the option or a default value for the option.

Usage

$WC_Shipping_Method = new WC_Shipping_Method();
$WC_Shipping_Method->get_instance_option( $key, $empty_value );
$key(string) (required)
Key.
$empty_value(mixed)
Empty value.
Default: null

Code of WC_Shipping_Method::get_instance_option() WC 5.8.0

public function get_instance_option( $key, $empty_value = null ) {
	if ( empty( $this->instance_settings ) ) {
		$this->init_instance_settings();
	}

	// Get option default if unset.
	if ( ! isset( $this->instance_settings[ $key ] ) ) {
		$form_fields                     = $this->get_instance_form_fields();
		$this->instance_settings[ $key ] = $this->get_field_default( $form_fields[ $key ] );
	}

	if ( ! is_null( $empty_value ) && '' === $this->instance_settings[ $key ] ) {
		$this->instance_settings[ $key ] = $empty_value;
	}

	$instance_option = apply_filters( 'woocommerce_shipping_' . $this->id . '_instance_option', $this->instance_settings[ $key ], $key, $this );
	return $instance_option;
}