WC_Admin_Notices::maybe_add_php72_required_notice()private staticWC 1.0

Add an admin notice about the bump of the required PHP version in WooCommerce 6.5 if the current PHP version is too old.

TODO: Remove this method in WooCommerce 6.5.

{} Это метод класса: WC_Admin_Notices{}

Хуков нет.

Возвращает

null. Ничего.

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

$result = WC_Admin_Notices::maybe_add_php72_required_notice();

Код WC_Admin_Notices::maybe_add_php72_required_notice() WC 6.4.1

private static function maybe_add_php72_required_notice() {
	if ( version_compare( phpversion(), '7.2', '>=' ) ) {
		return;
	}

	self::add_custom_notice(
		'php72_required_in_woo_65',
		__( '<h4>PHP version requirements will change soon</h4><p>WooCommerce 6.5, scheduled for <b>May 2022</b>, will require PHP 7.2 or newer to work. Your server is currently running an older version of PHP, so this change will impact your store. Upgrading to at least PHP 7.4 is recommended. <b><a href="https://developer.woocommerce.com/2022/01/05/new-requirement-for-woocommerce-6-5-php-7-2/">Learn more about this change.</a></b></p>', 'woocommerce' )
	);

	$wp_version_is_ok = version_compare( get_bloginfo( 'version' ), WC_NOTICE_MIN_WP_VERSION, '>=' );
	if ( $wp_version_is_ok ) {
		self::hide_notice( WC_PHP_MIN_REQUIREMENTS_NOTICE );
	}
}