Custom Fields
Support MB Frontend Submission [FRONT END SUBMISSION] Id on form rendered

  • Creator
  • #23567
    Resolved Kevin

    Hi everyone
    Mostly a suggestion than a support topic, you should add the form id to the rendered frontend form

    in wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Form.php
    Line 59

    echo '<form class="rwmb-form" method="post" enctype="multipart/form-data" encoding="multipart/form-data">';

    echo '<form class="rwmb-form" id="'.$this->config['id'].'" method="post" enctype="multipart/form-data" encoding="multipart/form-data">';

    It would be easier to, for example, target a specific form when you have multiple form on the same page, with a script or a style.

    Maybe there's a better way i am not aware of, havn't found this in docs (?).

    Thanks again for your great works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #23571
    Long Nguyen

    Hi Kevin,

    Thank you for your idea. I will create a feature request for the developer team to support adding the form ID by using meta box ID.

    For now, we can use two hooks rwmb_frontend_before_form and rwmb_frontend_after_form to create a wrapper for the form with the meta box ID.

    add_action( 'rwmb_frontend_before_form', function( $config ) {
        echo '<div id="' . $config['id'] . '" class="form-wrapper">';
    } );
    add_action( 'rwmb_frontend_after_form', function( $config ) {
        echo '</div>';
    } );

    Get more details in the documentation


    Hi Long,
    Thanks for your quick reply,
    i'll use the hook for now, and really hope that my feature requests will be implemented, that would be nice !

    have a nice day,

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