Automattic\WooCommerce\Internal\Admin\Settings
SettingsUIRequestContext::get_current_settings_section
Get the current WooCommerce settings section.
Reads $_REQUEST to match how the legacy $current_section global is derived, so context resolution and legacy settings rendering agree on the section.
Метод класса: SettingsUIRequestContext{}
Хуков нет.
Возвращает
string.
Использование
$result = SettingsUIRequestContext::get_current_settings_section(): string;
Код SettingsUIRequestContext::get_current_settings_section() SettingsUIRequestContext::get current settings section WC 11.2.2
private static function get_current_settings_section(): string {
// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
if ( ! isset( $_REQUEST['section'] ) ) {
return '';
}
$section = wp_unslash( $_REQUEST['section'] );
// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
return is_string( $section ) ? sanitize_title( $section ) : '';
}