protected function execute($args) { $link = new Prompt_Unsubscribe_Link($args); if (!$link->is_valid()) { return __('We tried to unsubscribe you, but there was some required information missing from this request.', 'Postmatic'); } $this->subscriber = $link->user(); $prompt_user = new Prompt_User($this->subscriber); $prompt_user->delete_all_subscriptions(); return sprintf(__('Got it. %s has been unsubscribed from new posts as well as any conversations.', 'Postmatic'), $this->subscriber->user_email); }
/** * When a user is deleted, remove their subscriptions. * * Hooks deleted_user. * @param $id */ public static function delete_subscriptions($id) { $prompt_user = new Prompt_User($id); $prompt_user->delete_all_subscriptions(); }