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.

Метод класса: WC_Settings_Page{}

Хуки из метода


Массив. Settings array, each item being an associative array representing a setting.


$WC_Settings_Page = new WC_Settings_Page();
$WC_Settings_Page->get_settings_for_section( $section_id );
$section_id(строка) (обязательный)
The id of the section to return settings for, an empty string for the default section.

Код WC_Settings_Page::get_settings_for_section() WC 9.0.2

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 );