/** * @return bool */ public function listen() { // make sure user is authorized to do the stuff we're about to do if (!current_user_can('delete_pages')) { return false; } if (empty($_REQUEST['wpkb_action'])) { return false; } $action = $_REQUEST['wpkb_action']; if ($action === 'delete_post_ratings') { $post_id = (int) $_REQUEST['post_id']; $this->rating->delete_post_ratings($post_id); } wp_safe_redirect(remove_query_arg('wpkb_action')); return true; }