WC_Settings_Page::get_settings_for_section()publicWC 1.0

Get settings array.

The strategy for getting the settings is as follows:

  • If a method named 'get_settings_for_{section_id}_section' exists in the class it will be invoked (for the default '' section, the method name is 'get_settings_for_default_section'). Derived classes can implement these methods as required.

  • Otherwise, 'get_settings_for_section_core' will be invoked. Derived classes can override it as an alternative to implementing 'get_settings_for_{section_id}_section' methods.

Method of the class: WC_Settings_Page{}

Hooks from the method

Return

Array. Settings array, each item being an associative array representing a setting.

Usage

$WC_Settings_Page = new WC_Settings_Page();
$WC_Settings_Page->get_settings_for_section( $section_id );
$section_id(string) (required)
The id of the section to return settings for, an empty string for the default section.

WC_Settings_Page::get_settings_for_section() code WC 8.7.0

final public function get_settings_for_section( $section_id ) {
	if ( '' === $section_id ) {
		$method_name = 'get_settings_for_default_section';
	} else {
		$method_name = "get_settings_for_{$section_id}_section";
	}

	if ( method_exists( $this, $method_name ) ) {
		$settings = $this->$method_name();
	} else {
		$settings = $this->get_settings_for_section_core( $section_id );
	}

	return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $section_id );
}