[rwmb_begin_html] is there any way to get the current config['id'] ?

Support MB Frontend Submission [rwmb_begin_html] is there any way to get the current config['id'] ?Resolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28023
    KevinKevin
    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

    #28035
    Long NguyenLong 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
    KevinKevin
    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 NguyenLong 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
    KevinKevin
    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 🙂

    #44829
    Nicholas CoxNicholas Cox
    Participant

    Hi Kevin,

    How did you do go about your latest answer? do you mind sharing your code please as im looking for this solution too.

    thanks

    Nick

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