Example #1
0
function hocwp_setup_warning_php_recommend_version()
{
    if (function_exists('hocwp_theme_license_valid') && !hocwp_theme_license_valid()) {
        unset($_GET['activated']);
        return;
    }
    global $wp_version;
    $transient_name = 'hocwp_warning_php_recommend_version_%s';
    $transient_name = hocwp_build_transient_name($transient_name, '');
    if (false === get_transient($transient_name)) {
        if (hocwp_is_admin()) {
            if (version_compare(PHP_VERSION, HOCWP_RECOMMEND_PHP_VERSION, '<')) {
                hocwp_setup_warning_php_minimum_version();
            }
        }
    }
}
function hocwp_setup_theme_check_license()
{
    if (!isset($_POST['submit']) && !hocwp_is_login_page()) {
        if (!hocwp_theme_license_valid(hocwp_theme_get_license_defined_data()) || !has_action('hocwp_check_license', 'hocwp_theme_custom_check_license')) {
            hocwp_theme_invalid_license_redirect();
        }
    }
}