WordPress at Your Fingertips
function is not described

WC_Shipping_Method::init_instance_settings() public WC 2.6.0

Initialise Settings for instances.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Shipping_Method = new WC_Shipping_Method();
$WC_Shipping_Method->init_instance_settings();

Changelog

Since 2.6.0 Introduced.

Code of WC_Shipping_Method::init_instance_settings() WC 5.8.0

public function init_instance_settings() {
	$this->instance_settings = get_option( $this->get_instance_option_key(), null );

	// If there are no settings defined, use defaults.
	if ( ! is_array( $this->instance_settings ) ) {
		$form_fields             = $this->get_instance_form_fields();
		$this->instance_settings = array_merge( array_fill_keys( array_keys( $form_fields ), '' ), wp_list_pluck( $form_fields, 'default' ) );
	}
}