WC_Settings_Page::get_settings_ui_request_context │ protected │ WC 1.0

Settings UI request context, or null when the modern settings SDK is unavailable.

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

Хуков нет.

Возвращает

SettingsUIRequestContext|null.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_settings_ui_request_context( $section );
$section(строка) (обязательный)
Section id.

Код WC_Settings_Page::get_settings_ui_request_context() WC 11.3.0

protected function get_settings_ui_request_context( $section ) {
	try {
		if ( ! class_exists( SettingsUIRequestContext::class ) ) {
			return null;
		}

		return SettingsUIRequestContext::for_settings_page( $this, $section );
	} catch ( \Throwable $e ) {
		return null;
	}
}