Custom Fields
Re-Envisioned
Support General Select Advanced does not execute callback

  • Creator
    Topic
  • #30868
    Resolved Fede
    Participant

    Through Meta Box Builder I have created an advanced select that retrieves its options through a callback function, but when it is displayed to the user it does not update the options if there have been changes unless I change the field type and set it back to advanced select.

    How can I make it always execute the callback?

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

    Hi,

    Please refer to this topic https://metabox.io/support/topic/select-choices-callback-cache/

    You can use the code to register the field to get the updated value of the callback function on loading or update the field group in the Builder manually.

    #31053
    Fede
    Participant

    Thanks, I finally solved it by using the normalize filter of the field:

    add_filter('rwmb_normalize_languages_field', function($field) {
        $field['options'] = ks_get_languages();
        return $field;
    });
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.