rtCamp\WP\Nginx\Helper::purge_all PHP Method

purge_all() public method

public purge_all ( )
        function purge_all()
        {
            if (!isset($_REQUEST['nginx_helper_action'])) {
                return;
            }
            if (!current_user_can('manage_options')) {
                wp_die('Sorry, you do not have the necessary privileges to edit these options.');
            }
            $action = $_REQUEST['nginx_helper_action'];
            if ($action == 'done') {
                add_action('admin_notices', array(&$this, 'show_notice'));
                add_action('network_admin_notices', array(&$this, 'show_notice'));
                return;
            }
            check_admin_referer('nginx_helper-purge_all');
            switch ($action) {
                case 'purge':
                    $this->true_purge_all();
                    break;
            }
            wp_redirect(esc_url_raw(add_query_arg(array('nginx_helper_action' => 'done'))));
        }