WC_Admin_Notices::reset_admin_notices
Reset notices for themes when switched or a new version of WC is installed.
Метод класса: WC_Admin_Notices{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$result = WC_Admin_Notices::reset_admin_notices();
Код WC_Admin_Notices::reset_admin_notices() WC Admin Notices::reset admin notices WC 11.3.0
public static function reset_admin_notices() {
// Notice about the PHP 8.1 requirement in WooCommerce 11.6, remove in that version (see also init).
if ( function_exists( 'phpversion' ) && version_compare( phpversion(), '8.1', '<' ) ) {
self::add_custom_notice(
'php81_required_in_woo_116',
sprintf(
'<div class="wc-php-version-notice"><h4>%s</h4>%s%s<p class="wc-php-version-notice__learn-more"><b><a href="%s" target="_blank" rel="noopener noreferrer">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></b></p></div>',
esc_html__( 'PHP version requirements will change soon', 'woocommerce' ),
wpautop(
wp_kses_data(
sprintf(
/* translators: %s: The PHP version the server is currently running. */
__( 'WooCommerce 11.6, planned for release in <b>February 2027</b>, will require PHP 8.1 or newer to work. Your server is currently running PHP %s, so this change will impact your store. Please contact your hosting provider to upgrade to the latest PHP 8.3 release or newer (PHP 8.1 is the minimum WooCommerce will require).', 'woocommerce' ),
phpversion()
)
)
),
// CVE-2026-109618 and CVE-2026-109619 affect every PHP release below 8.2.35, and PHP has no fixed release below 8.2, so every version this notice targets is affected.
wpautop(
wp_kses_data(
sprintf(
/* translators: %s: The PHP version the server is currently running. */
__( '<b>Your PHP version may also be affected by critical security vulnerabilities.</b> Official PHP %s releases do not include the fixes for CVE-2026-109618 and CVE-2026-109619 (disclosed in October 2026), which can let attackers run code on your server. Some hosting providers apply these fixes themselves, so when you contact yours about upgrading, ask them to confirm your server is patched.', 'woocommerce' ),
phpversion()
)
)
),
esc_url(
add_query_arg(
array(
'utm_source' => 'admin_notice',
'utm_medium' => 'product',
'utm_campaign' => 'php81_requirement',
'utm_content' => 'learn_more',
),
'https://developer.woocommerce.com/2026/09/29/php-8-1-requirement/'
)
),
esc_html__( 'Learn more about this change', 'woocommerce' ),
esc_html__( '(opens in a new tab)', 'woocommerce' )
)
);
}
}