Custom Fields
Re-Envisioned
Support Meta Box Group Group Sanitzie Callback

  • Creator
    Topic
  • #17962
    Resolved Austin Passy
    Participant

    When using a group type that is clonable, the fields sanitize callback gets looped through. Is there another way from the Metabox API to get around this?

    Example; There is one post advanced select field in a group, if we wanted to make sure that no duplicate post IDs are selected the sanitize_callback isn’t aware of the collection of values, but each cloned field value. Does that make sense? (basically logging the value of that callback returns the array(POST_ID_OF_SELECTION) * N (number of cloned fields) (instead of array(0=>ID, 1=>ID) etc.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #17991
    Anh Tran
    Keymaster

    Hi Austin,

    You’re right. The way we built the sanitize_callback is for each cloned value, to make sure it’s correct.

    In your case, I’d suggest using rwmb_{$field_id}_value which allows you to check and modify the submitted value.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash