WC_Admin_Notices::wp_php_min_requirements_notice()
Notice about WordPress and PHP minimum requirements.
Method of the class: WC_Admin_Notices{}
Hooks from the method
Return
null
. Nothing.
Usage
$result = WC_Admin_Notices::wp_php_min_requirements_notice();
Changelog
Since 3.6.5 | Introduced. |
WC_Admin_Notices::wp_php_min_requirements_notice() WC Admin Notices::wp php min requirements notice code WC 7.5.1
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'; }