Meta Box
Support Forum
Support › MB Frontend Submission › apply_filters field meta not workingResolved
Hi
I am using the following code, but it is not working in my functions file. The value is not updating and i receive no errors.
apply_filters( 'rwmb_myfieldtest_field_meta', 'test');
thanks
Hello,
You should use the function add_filter() to hook your callback function to that filter hook. Please follow the documentation https://developer.wordpress.org/reference/functions/add_filter/
I remember you have an example in one of previous topics https://support.metabox.io/topic/rwmb-field-meta-filter-for-cloneable-groups/
Hi, yes i am aware that I need a add_filter, but when i call apply_filters it doesnt affect the output when i pass in the parameter of 'test'. When i error_log this test in PHP i can see that the 'test' string is being called after metabox has ran.
add_filter
apply_filters
Because the apply_filters is added in the Meta Box source code. You need to use add_filter to add the callback function on your side.
ok thanks