set_name( $name ); if ( $Category->save() ) { Messages::getInstance()->add( __( 'Category updated', 'double-opt-in' ), 'success' ); } else { Messages::getInstance()->add( __( 'Category update failed', 'double-opt-in' ), 'error' ); } } /** * Hide this page in the menu. * * @return bool */ public function hideInMenu() { return true; } /** * Render the license subpage content */ protected function theContent( $slug, $page, $settings ) { /* * Ensure that the ID for the Categorie is set */ if ( ! isset( $_GET['id'] ) ) { wp_redirect( admin_url( 'admin.php' ) . '?page=f12-cf7-doubleoptin' ); } $id = (int) $_GET['id']; /* * Load the assigned Category */ $Category = Category::get_by_id( $id ); if ( null === $Category ) { wp_redirect( admin_url( 'admin.php' ) . '?page=f12-cf7-doubleoptin' ); } $atts = array( 'perPage' => 10, 'page' => 1, 'order' => 'DESC', ); if ( isset( $_GET['pageNum'] ) ) { $atts['page'] = (int) $_GET['pageNum']; } if ( isset( $_GET['perPage'] ) ) { $atts['perPage'] = (int) $_GET['perPage']; } if ( isset( $_GET['keyword'] ) ) { $atts['keyword'] = sanitize_text_field( $_GET['keyword'] ); } $numberOfPages = 0; $listOfOptIns = OptIn::get_list_by_category_id( $Category->get_id(), $atts, $numberOfPages ); /* * Render the Template */ ?>

get_name() ); ?>

TemplateHandler->renderTemplate( 'list-optins', array( 'domain' => $this->domain, 'listOfOptIns' => $listOfOptIns, 'numberOfPages' => $numberOfPages, 'currentPage' => $atts['page'], 'slug' => $slug ) ); } protected function theSidebar( $slug, $page ) { /* * Ensure that the ID for the Categorie is set */ if ( ! isset( $_GET['id'] ) ) { wp_redirect( admin_url( 'admin.php' ) . '?page=f12-cf7-doubleoptin' ); } $id = (int) $_GET['id']; /* * Load the assigned Category */ $Category = Category::get_by_id( $id ); ?>