Custom Fields
Re-Envisioned
Support MB Frontend Submission [rwmb_begin_html] is there any way to get the current config['id'] ?

  • Creator
    Topic
  • #28023
    Resolved Kevin
    Participant

    Hi everyone @MB.IO

    i am currently try to filter html output for some fields, with a fieldset disabled wrapping around each fields on some condition.

    i am using rwmb_begin_html and rwmb_end_html filter to do so, but as i have many forms on the same page, all of them take the filter, and are disabled.

    is there any way we could target a specific form using rwmb_begin_html to, for example, apply a specific mods to this form id only (and not the others) ?

    thanks for your time, and nice to see you have implemented form id on frontend submission, it's a real gain of time 🙂

    have a nice day and a nice week end
    Kevin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #28035
    Long Nguyen
    Moderator

    Hi,

    This filter also supports changing for a specific field ID. Please use

    rwmb_{$field_id}_begin_html

    See more on this documentation https://docs.metabox.io/filters/#rwmb_begin_html

    #28043
    Kevin
    Participant

    Hi Long, thanks for your quick reply,

    i was aware of this, but more generally is it possible to traget the whole form the field ID is in ?

    thanks again,

    #28053
    Long Nguyen
    Moderator

    Hi Kevin,

    The extension MB Frontend Submission does not support filtering the appearance of the form. You can try to use the meta box ID when passing to the shortcode to style the form.

    form#meta-box-id {
        your CSS code here
    }
    #28061
    Kevin
    Participant

    Hi Long,

    finally found a way more secure than css, using rwmb_get_registry and passing the form id to my hook,

    like that, i can loop through each unique form field using rwmb_{$field_id}_begin_html, as the rwmb_get_registry->get method loop only to the form i pass through my hook

    thanks for your time and help, you show me the way 🙂

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