'You do not have permission to reset site !')); } $reset_todo = optGET('reset_todo'); if(empty($reset_todo) || !in_array($reset_todo, array('pages', 'posts', 'all'))){ wp_send_json(array('error' => 'Invalid reset action')); } // Reset the site $ret = sitepad_reset_site_fn($reset_todo); if($ret){ wp_send_json(array('done' => 1)); }else{ wp_send_json(array('error' => 'An unexpected error occured')); } }