/**
 * Clear cache when WooThemes options are updated.
 */
function ccfm_clear_cache_for_woo_options()
{
    ccfm_clear_cache_for_me('woo_options');
}
/**
 * Clear the cache if requested.
 */
function ccfm_handle_requests()
{
    if (isset($_POST['ccfm'])) {
        check_admin_referer('ccfm');
        $needed_cap = get_option('ccfm_permission', 'manage_options');
        $is_success = 0;
        if (current_user_can($needed_cap)) {
            ccfm_clear_cache_for_me('button');
            $is_success = 1;
            add_action('admin_notices', 'ccfm_success');
        } else {
            add_action('admin_notices', 'ccfm_error');
        }
        wp_safe_redirect(admin_url() . '?ccfm_success=' . $is_success);
        exit;
    }
    if (isset($_GET['ccfm_success'])) {
        if (!empty($_GET['ccfm_success'])) {
            add_action('admin_notices', 'ccfm_success');
        } else {
            add_action('admin_notices', 'ccfm_error');
        }
    }
    if (isset($_GET['ccfm_asuccess'])) {
        if (!empty($_GET['ccfm_asuccess'])) {
            add_action('admin_notices', 'ccfm_admin_success');
        } else {
            add_action('admin_notices', 'ccfm_error');
        }
    }
}
/**
 * Clear cache when Contact Form 7 forms are saved.
 */
function ccfm_clear_cache_for_cf7()
{
    ccfm_clear_cache_for_me('cf7');
}