wpcf7_admin_management_page
The Contact Form 7 wpcf7 admin management page function.
Description
wpcf7_admin_management_page();
Usage
if ( !function_exists( 'wpcf7_admin_management_page' ) ) { require_once ABSPATH . PLUGINDIR . 'contact-form-7/admin/admin.php'; } // NOTICE! Understand what this does before running. $result = wpcf7_admin_management_page();
Defined (1)
The function is defined in the following location(s).
- /admin/admin.php
- 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;
- }
- if ( 'validate' == wpcf7_current_action()
- && current_user_can( 'wpcf7_edit_contact_forms' ) ) {
- return;
- }
- $list_table = new WPCF7_Contact_Form_List_Table();
- $list_table->prepare_items();
- ?>
- <div class="wrap">
- <h1><?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'] ) );
- }
- ?></h1>
- <?php do_action( 'wpcf7_admin_warnings' ); ?>
- <?php wpcf7_welcome_panel(); ?>
- <?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