Created
December 9, 2019 13:53
-
-
Save markbiek/d0c631ac43e98546aa1bd3f6c28d70c7 to your computer and use it in GitHub Desktop.
Check for a specific PHP version from a WordPress plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load the current WP core version | |
include( ABSPATH . WPINC . '/version.php' ); | |
if (version_compare($wp_version, '5.3') < 0) { | |
//If WP core is < 5.3, do a PHP version check ourselves | |
$php_version = phpversion(); | |
if (version_compare($php_version, '7.1') < 0) { | |
die('This plugin requires PHP 7.1 or higher'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment