Gravity Forms + Custom Post Types
Gravity Forms + Custom Post Types without Title (3 posts)

  1. wpoo
    Posted 2 years ago #


    Thank you for this nice plugin. It's working great!
    There's only one question.


    In the link above I already read that the plugin's author says a title field must be added in the GF form-editor in order to save the entries to a Custom Post Type.

    But I want to pre-set CPTs with a given title and only want users to be able to edit the Body and not the title at all.

    I use Gravity Forms and the two extensions Custom Post Types and Update Post


    Already found this in gfcptaddon_1-5.php in line 136 to line 153.

    <li class="custom_post_type_field_setting field_setting" style="display:list-item;">
                        <input type="checkbox" id="field_enable_custom_post_type" />
                        <label for="field_enable_custom_post_type" class="inline">
                            <?php _e("Save As Post Type", "gravityforms"); ?>
                        <?php gform_tooltip("form_field_custom_post_type") ?><br />
                        <select id="field_populate_custom_post_type" onchange="SetFieldProperty('saveAsCPT', jQuery(this).val());" style="margin-top:10px; display:none;">
                            <option value="" style="color:#999;">Select a Post Type</option>
                          'public'   => true
                        $post_types = get_post_types($args, 'objects');
                        foreach($post_types as $post_type): ?>
                            <option value="<?php echo $post_type->name; ?>"><?php echo $post_type->label; ?></option>
                        <?php endforeach; ?>

    How to Change the Position of the Checkbox to be outside of the title (post-field)?


    Any suggestions? Thanks in advance.


  2. Robbie_berns
    Posted 2 years ago #

    I would think that the simplest is to create the title field, pre-populate it with your default value, and make it hidden in CSS rules.


  3. Clifford Paulick
    Posted 2 years ago #

    Change "visibility" to "admin-only" -- don't use CSS.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Gravity Forms + Custom Post Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic