コード例 #1
-1
ファイル: admin.php プロジェクト: sontv1003/thepdahoi
function wpcf7_admin_management_page()
{
    $contact_forms = wpcf7_contact_forms();
    $unsaved = false;
    if (!isset($_GET['contactform'])) {
        $_GET['contactform'] = '';
    }
    if ('new' == $_GET['contactform']) {
        $unsaved = true;
        $current = -1;
        $cf = wpcf7_contact_form_default_pack(isset($_GET['locale']) ? $_GET['locale'] : '');
    } elseif ($cf = wpcf7_contact_form($_GET['contactform'])) {
        $current = (int) $_GET['contactform'];
    } else {
        $first = reset($contact_forms);
        // Returns first item
        $current = $first->id;
        $cf = wpcf7_contact_form($current);
    }
    require_once WPCF7_PLUGIN_DIR . '/admin/edit.php';
}
コード例 #2
-1
ファイル: admin.php プロジェクト: alanhogan/contact-form-8
function wpcf7_admin_management_page()
{
    global $wp_version;
    switch ($_GET['message']) {
        case 'created':
            $updated_message = __("Contact form created.", 'wpcf7');
            break;
        case 'saved':
            $updated_message = __("Contact form saved.", 'wpcf7');
            break;
        case 'deleted':
            $updated_message = __("Contact form deleted.", 'wpcf7');
            break;
        case 'table_created':
            $updated_message = __("Database table created.", 'wpcf7');
            break;
        case 'table_not_created':
            $updated_message = __("Failed to create database table.", 'wpcf7');
            break;
    }
    $contact_forms = wpcf7_contact_forms();
    $id = $_POST['wpcf7-id'];
    if ('new' == $_GET['contactform']) {
        $unsaved = true;
        $current = -1;
        $cf = wpcf7_contact_form_default_pack();
    } elseif ($cf = wpcf7_contact_form($_GET['contactform'])) {
        $current = (int) $_GET['contactform'];
    } else {
        $first = reset($contact_forms);
        // Returns first item
        $current = $first->id;
        $cf = wpcf7_contact_form($current);
    }
    require_once WPCF8_PLUGIN_DIR . '/admin/admin-panel.php';
}