I've got theme that requires php 5.3+ version. If older - fatal error occurs with it.
So what I need to do when user try to activate this theme is to check php version before going into theme code and then, if php version is too old, show some message and don't activate my theme, but stay with the one that was active before
Is it possible?
I've got this code to check version
define("THEME_REQUIRED_PHP_VERSION", '5.3.0');
define("THEME_IGNORE_PHP_VERSION", 0);
//check if good php version
if ( !THEME_IGNORE_PHP_VERSION&& version_compare(phpversion(), THEME_REQUIRED_PHP_VERSION, '<')) {
// php version isn't high enough
wp_die("<h2>You need to update php version.</h2>Too old version of PHP to run Circle Theme. Actual version is <strong>" . phpversion() . "</strong>, required is <strong>" . CIRCLE_REQUIRED_PHP_VERSION . "</strong>.", "Theme");
}
However this cannot be becouse theme is activated anyway and user can't do anything.