WordPress at Your Fingertips
function is not described

WC_Settings_API::init_settings() public WC 1.0.0

Initialise Settings.

Store all settings in a single database entry and make sure the $settings array is either the default or the settings stored in the database.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Settings_API = new WC_Settings_API();
$WC_Settings_API->init_settings();

Changelog

Since 1.0.0 Introduced.

Code of WC_Settings_API::init_settings() WC 5.5.2

<?php
public function init_settings() {
	$this->settings = get_option( $this->get_option_key(), null );

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