WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. wpoo
    Member
    Posted 8 months ago #

    Hey,

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

    http://wordpress.org/support/topic/plugin-gravity-forms-custom-post-types-post-title-and-conditional-custom-post-types

    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

    http://wordpress.org/plugins/gravity-forms-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"); ?>
                        </label>
                        <?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>
                        <?php
                        $args=array(
                          '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; ?>
                        </select>
                    </li>

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

    http://s.wordpress.org/plugins/gravity-forms-custom-post-types/screenshot-3.png?r=754726

    Any suggestions? Thanks in advance.

    http://wordpress.org/plugins/gravity-forms-custom-post-types/

  2. Robbie_berns
    Member
    Posted 8 months 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.

    voila!

  3. Clifford Paulick
    Member
    Posted 5 months ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic