function wpcf7_admin_management_page() { if ($post = wpcf7_get_current_contact_form()) { $post_id = $post->initial() ? -1 : $post->id(); require_once WPCF7_PLUGIN_DIR . '/admin/includes/editor.php'; require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php'; return; } $list_table = new WPCF7_Contact_Form_List_Table(); $list_table->prepare_items(); ?> <div class="wrap"> <h2><?php echo esc_html(__('Contact Forms', 'contact-form-7')); if (current_user_can('wpcf7_edit_contact_forms')) { echo ' <a href="' . esc_url(menu_page_url('wpcf7-new', false)) . '" class="add-new-h2">' . esc_html(__('Add New', 'contact-form-7')) . '</a>'; } if (!empty($_REQUEST['s'])) { echo sprintf('<span class="subtitle">' . __('Search results for “%s”', 'contact-form-7') . '</span>', esc_html($_REQUEST['s'])); } ?> </h2> <?php do_action('wpcf7_admin_notices'); ?> <form method="get" action=""> <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']); ?> " /> <?php $list_table->search_box(__('Search Contact Forms', 'contact-form-7'), 'wpcf7-contact'); ?> <?php $list_table->display(); ?> </form> </div> <?php }
function wpcf7_admin_management_page() { $post = null; $unsaved = false; if (!isset($_GET['post'])) { $_GET['post'] = ''; } if ('new' == $_GET['post'] && current_user_can('wpcf7_edit_contact_forms')) { $unsaved = true; $post_id = -1; $post = wpcf7_get_contact_form_default_pack(array('locale' => isset($_GET['locale']) ? $_GET['locale'] : '')); } elseif ($post = wpcf7_contact_form($_GET['post'])) { $post_id = (int) $_GET['post']; } if ($post) { require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php'; require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php'; return; } $list_table = new WPCF7_Contact_Form_List_Table(); $list_table->prepare_items(); ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php echo esc_html(__('Contact Form 7', 'wpcf7')); echo ' <a href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal" class="add-new-h2 thickbox">' . esc_html(__('Add New', 'wpcf7')) . '</a>'; if (!empty($_REQUEST['s'])) { echo sprintf('<span class="subtitle">' . __('Search results for “%s”', 'wpcf7') . '</span>', esc_html($_REQUEST['s'])); } ?> </h2> <?php do_action('wpcf7_admin_notices'); ?> <form method="get" action=""> <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']); ?> " /> <?php $list_table->search_box(__('Search Contact Forms', 'wpcf7'), 'wpcf7-contact'); ?> <?php $list_table->display(); ?> </form> </div> <?php wpcf7_admin_lang_select_modal(); }
function wpcf7_admin_management_page() { global $wpcf7_contact_form; if ($wpcf7_contact_form) { $post =& $wpcf7_contact_form; $post_id = $post->initial ? -1 : $post->id; require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php'; require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php'; return; } $list_table = new WPCF7_Contact_Form_List_Table(); $list_table->prepare_items(); ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php echo esc_html(__('Contact Form 7', 'wpcf7')); echo ' <a href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal" class="add-new-h2 thickbox">' . esc_html(__('Add New', 'wpcf7')) . '</a>'; if (!empty($_REQUEST['s'])) { echo sprintf('<span class="subtitle">' . __('Search results for ---- “%s”', 'wpcf7') . '</span>', esc_html($_REQUEST['s'])); } ?> </h2> <?php do_action('wpcf7_admin_notices'); ?> <form method="get" action=""> <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']); ?> " /> <?php $list_table->search_box(__('Search Contact Forms', 'wpcf7'), 'wpcf7-contact'); ?> <?php $list_table->display(); ?> </form> </div> <?php wpcf7_admin_lang_select_modal(); }