deleteByHash($hash)) { wp_redirect('admin.php?page=f12-cf7-doubleoptin&status=deleted'); wp_die(); } else { wp_redirect('admin.php?page=f12-cf7-doubleoptin&status=error'); wp_die(); } } else if (isset($_GET['status'])) { $status = $_GET['status']; if ($status == 'deleted') { Messages::getInstance()->add(__('The given DOI has been removed.', 'double-opt-in'), 'success'); } if ($status == 'error') { Messages::getInstance()->add(__('Couldn\'t delete the DOI, please try again later.', 'double-opt-in'), 'error'); } } } public function theContent($slug, $page, $settings) { // Check if there is a call to delete an specific entry $this->maybeDelete(); // Render the optins $this->renderLatestOptIns($slug, $page); } private function renderLatestOptins($slug, $page) { $atts = array( 'perPage' => 10, 'page' => 1, 'order' => 'DESC', 'keyword' => '' ); if(isset($_GET['perPage'])){ $atts['perPage'] = (int)$_GET['perPage']; } if (isset($_GET['pageNum'])) { $atts['page'] = (int)$_GET['pageNum']; } if(isset($_GET['keyword'])){ $atts['keyword'] = sanitize_text_field($_GET['keyword']); } if(isset($_GET['cf_form_id'])){ $atts['cf_form_id'] = (int)$_GET['cf_form_id']; } $numberOfPages = 0; $listOfOptIns = OptIn::get_list($atts, $numberOfPages); /* * Render the Template */ ?>
renderTemplate('list-optins', array( 'domain' => $this->domain, 'listOfOptIns' => $listOfOptIns, 'numberOfPages' => $numberOfPages, 'currentPage' => $atts['page'], 'slug' => $slug )); } public function theSidebar($slug, $page) { ?>
add_action('f12_cf7_doubleoptin_already_confirmed', $hash, $OptIn)
add_action('f12_cf7_doubleoptin_before_confirm', $hash, $OptIn)
add_action('f12_cf7_doubleoptin_after_confirm', $hash, $OptIn)