• Creator
    Topic
  • #28951
    Infolu
    Participant

    Hi guys, I have a post type that by the admin area some fields are automatically completed with information, now I'm using mb frontend submission and I need to complete these fields with information how can I do this?

    $form = '[mb_frontend_form post_type="talk" id="talk_mb_info"]';
    echo do_shortcode( $form );
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #28966
    Long Nguyen
    Moderator

    Hi,

    Can you please clarify the question? I do not understand it clearly.

    If a field works in the backend, it also works in the form on the frontend.

    #28969
    Infolu
    Participant

    Hi Long, what I need is that when I save a form the field I specify is automatically filled in, for example

    On my site page there is a function that captures the ip of the visitor I want that when I click on save form from mb frontend , this information is saved in a metatag of my post

    Today in my back-end when I go to my post-type and register a new post when saving I have fields that automatically save information.

    #28971
    Infolu
    Participant

    In other words, I have hidden fields in this post type, which information must be inserted when saving the mb frontend form.

    #28981
    Long Nguyen
    Moderator

    Hi,

    I think you can use the action hook rwmb_frontend_after_process to update the field value after submitting the form.

    Use the function update_post_meta() to update the field value and refer to this documentation https://docs.metabox.io/extensions/mb-frontend-submission/#form-actions

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.