WordPress at Your Fingertips
function is not described

WC_Settings_Page::get_settings_for_section() public WC 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.

{} It's a 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.

Code of WC_Settings_Page::get_settings_for_section() WC 5.9.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 );
}