Filter field before displaying in frontend form

Support MB Frontend Submission Filter field before displaying in frontend formResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39911
    shmaltzshmaltz
    Participant

    I am processing my field value through htmlspecialchars() before saving to db.

    When I edit the field via the Frontend Submission extension, I want to run the field through htmlspecialchars_decode() before it's displayed in the frontend form.

    How can I do that? Is there a filter before loading a field in the frontend form?

    #39925
    PeterPeter
    Moderator

    Hello,

    To process the field value before saving it to the database, you can use the filter hook rwmb_{$field_type}_value or use the sanitize callback function. And use the filter hook rwmb_field_meta to change the field value before displaying it in the editing form.

    Please read more on the documentation
    https://docs.metabox.io/filters/rwmb-field-type-value/
    https://docs.metabox.io/sanitization/
    https://docs.metabox.io/filters/rwmb-field-meta/

    #39932
    shmaltzshmaltz
    Participant

    This helped a lot!

    Thanks!

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