WC_Shipping_Method::init_instance_settings()
Initialise Settings for instances.
Description Description
Source Source
File: includes/abstracts/abstract-wc-shipping-method.php
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' ) ); } }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |