<?php
 namespace RtmMail; use RtmMail\Helpers\EventHelper; class Events extends AbstractPage { protected $slug = 'events'; public function __construct() { parent::__construct(); } public function handle_requests() { if (isset($_POST['action'])) { if ($_POST['action'] === 'clear_events') { if (wp_verify_nonce($_POST['_wpnonce'], 'rtm_mail_clear_events')) { $settings = get_option('rtm_mail_settings'); $clear_deleted_only = $settings['clear_deleted_events'] ?? true; EventHelper::delete($clear_deleted_only); } } } } public function display() { if ($this->page_check()) { require __DIR__ . '/Views/' . $this->slug . '.php'; } } } 