Support

Account

Home Forums Backend Issues (wp-admin) Are "Message" fields filterable?

Solved

Are "Message" fields filterable?

  • I have a message field and I can’t name it.

    When I inspect it, I get a valid field ID, but when I try to add a filter for that ID it never gets called.

    acf/load_value/name=field_5b88597eb0210

    I’m guessing that Message fields can not be filtered.

  • I haven’t personally tried filtering a message field, however your syntax looks slightly incorrect.

    See this page: https://www.advancedcustomfields.com/resources/acf-load_value/

    Specifically:

    // acf/load_value/name={$field_name} - filter for a specific value load based on it's field name
    add_filter('acf/load_value/name=my_select', 'my_acf_load_value', 10, 3);
    
    // acf/load_value/key={$field_key} - filter for a specific field based on it's name
    add_filter('acf/load_value/key=field_508a263b40457', 'my_acf_load_value', 10, 3);

    You have name in your code where you are passing a field key.

  • Thank you, I had two issues with my code…

    First (as you noted) I was using “name=field_key” which was wrong, it should have been “key=field_key”.

    Second, “load_value” is not filtered for messages. However, “load_field” is and I was able to use that.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Are "Message" fields filterable?’ is closed to new replies.