Select Advanced does not execute callback

Support General Select Advanced does not execute callbackResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30868
    FedeFede
    Participant

    Through MB 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?

    #30872
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please refer to this topic https://support.metabox.io/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
    FedeFede
    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;
    });
    #33055
    DANIEL FITIPALDO R.DANIEL FITIPALDO R.
    Participant

    Excelente Fede, thank you for the solution!

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