Home › Forums › Feature Requests › Separate Metabox Title Field › Reply To: Separate Metabox Title Field
I recently found that James’ solution to this problem (which I had been using successfully for some time) stopped working in my project. I did a little digging and discovered that two changes to the last line in his example are necessary to get it working again.
First, the acf/get_field_groups
filter was deprecated in ACF 5.7.11 in favour of acf/load_field_groups
, so you’ll need to update accordingly. Simple enough, but it only gets you half way: If you dump the field group data before and after, you’ll see the titles changing properly, but for whatever reason those new titles don’t get used in the edit screen metaboxes.
Second, you need to change the priority of the filter. WordPress filters default to a priority of 10, with numbers closer to 0 indicating earlier execution order. To ensure our changes don’t get overwritten, we actually want to apply this filter later, meaning we want a higher number. 20 seems to be working okay for me right now. I believe it became necessary to set priority in this case in ACF 5.7.10 with the addition of the _acf_apply_get_local_field_groups
function, which also uses this filter at priority 20.
TL;DR, James’ solution should work if we update the last line to read:
add_filter('acf/load_field_groups', 'my_acf_change_metabox_title', 20);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.