WC_Shipping_Method::init_instance_settings()
Initialise Settings for instances.
Method of the class: WC_Shipping_Method{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Shipping_Method = new WC_Shipping_Method(); $WC_Shipping_Method->init_instance_settings();
Changelog
Since 2.6.0 | Introduced. |
WC_Shipping_Method::init_instance_settings() WC Shipping Method::init instance settings code WC 8.7.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' ) ); } }