WC_Admin_Notices::wp_php_min_requirements_notice()

Notice about WordPress and PHP minimum requirements.


Description Description


Return Return

(void)


Top ↑

Source Source

File: includes/admin/class-wc-admin-notices.php

	public static function wp_php_min_requirements_notice() {
		if ( apply_filters( 'woocommerce_hide_php_wp_nag', get_user_meta( get_current_user_id(), 'dismissed_' . WC_PHP_MIN_REQUIREMENTS_NOTICE . '_notice', true ) ) ) {
			self::remove_notice( WC_PHP_MIN_REQUIREMENTS_NOTICE );
			return;
		}

		$old_php = version_compare( phpversion(), WC_NOTICE_MIN_PHP_VERSION, '<' );
		$old_wp  = version_compare( get_bloginfo( 'version' ), WC_NOTICE_MIN_WP_VERSION, '<' );

		// Both PHP and WordPress up to date version => no notice.
		if ( ! $old_php && ! $old_wp ) {
			return;
		}

		if ( $old_php && $old_wp ) {
			$msg = sprintf(
				/* translators: 1: Minimum PHP version 2: Minimum WordPress version */
				__( 'Update required: WooCommerce will soon require PHP version %1$s and WordPress version %2$s or newer.', 'woocommerce' ),
				WC_NOTICE_MIN_PHP_VERSION,
				WC_NOTICE_MIN_WP_VERSION
			);
		} elseif ( $old_php ) {
			$msg = sprintf(
				/* translators: %s: Minimum PHP version */
				__( 'Update required: WooCommerce will soon require PHP version %s or newer.', 'woocommerce' ),
				WC_NOTICE_MIN_PHP_VERSION
			);
		} elseif ( $old_wp ) {
			$msg = sprintf(
				/* translators: %s: Minimum WordPress version */
				__( 'Update required: WooCommerce will soon require WordPress version %s or newer.', 'woocommerce' ),
				WC_NOTICE_MIN_WP_VERSION
			);
		}

		include dirname( __FILE__ ) . '/views/html-notice-wp-php-minimum-requirements.php';
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.6.5 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.