Group Sanitzie Callback

Support MB Group Group Sanitzie CallbackResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17962
    Austin PassyAustin 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.

    #17991
    Anh TranAnh 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 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.