Custom Fields
Re-Envisioned
Support MB Frontend Submission Title of post is removed after updating the post

  • Creator
    Topic
  • #12407
    Resolved EddyPiV
    Participant

    I am building a membersite where my members will enter their details through Frontend Submission.
    They also can update their own details.
    But… with the update the title of the post gets removed… (No title)

    To update I use:
    [mb_frontend_form id=”<the field groups>” post_id=”current” submit_button=”Update” confirmation=”Your profile has been updated successfully.”]

    How to resolve this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #12436
    Anh Tran
    Keymaster

    Hi,

    Please add post_fields="title" to the shortcode. It will tell the extension to add post title field to the form and process its value.

    #12447
    EddyPiV
    Participant

    Great, that was it.

    Thanks!

    #18447
    netalys
    Participant

    Hey Anh, ok it’s working but what about if we don’t want the user to edit the title ?
    Thanks.
    Cedric.

    #18464
    Anh Tran
    Keymaster

    Hi netalys,

    You probably need to set attribute disabled or readonly for the title field. Please see this blog post to know how to create custom settings for post fields.

    #18476
    netalys
    Participant

    OK but I can’t find the info in the link you provide…
    The title is not a field we define in the custom fields, I don’t understand how to do this…

    It should be awesome that if we don’t add post_fields=”title” in the shortcode then the title doesn’t change rather then updating for “No title”.

    #18490
    Anh Tran
    Keymaster

    Hi Cedric,

    To be able to set a custom attribute for title, you need to create a text field and put it in the meta box (which has ID in the shortcode), like this:

    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
        $meta_boxes[] = [
            'title' => 'Your title',
            'id'    => 'your-id',
            'fields' => [
                [
                    'title' => 'Post title',
                    'id' => 'post_title',
                    'disabled' => true,
                ],
                // Other fields here
            ],
        ];
    } );

    And in your shortcode, don’t include the post_fields parameter:

    [mb_frontend_form id="your-id"]
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash