function hocwp_option_plugin_license_sanitized($input)
{
    $use_for = isset($input['use_for']) ? $input['use_for'] : '';
    if (!empty($use_for)) {
        $customer_email = isset($input['customer_email']) ? $input['customer_email'] : '';
        if (is_email($customer_email)) {
            $code = isset($input['license_code']) ? $input['license_code'] : '';
            $code = strtoupper($code);
            $option = get_option('hocwp_plugin_licenses');
            $use_for_key = md5($use_for);
            $option[$use_for_key]['customer_email'] = $customer_email;
            $option[$use_for_key]['license_code'] = $code;
            update_option('hocwp_plugin_licenses', $option);
        }
    }
    hocwp_delete_transient_license_valid();
}
Exemple #2
0
function hocwp_setup_admin_init()
{
    $saved_domain = get_option('hocwp_domain');
    $current_domain = hocwp_get_root_domain_name(get_bloginfo('url'));
    if ($saved_domain != $current_domain) {
        update_option('hocwp_domain', $current_domain);
        hocwp_delete_transient_license_valid();
        do_action('hocwp_change_domain');
    }
}
function hocwp_theme_license_option_saved($option)
{
    if (is_a($option, 'HOCWP_Option')) {
        hocwp_delete_transient_license_valid();
    }
}