I submitted a support ticket and figured I’d post a thread here too in hopes that someone has experienced the same thing. I need to get this figured out as soon as possible so any help would be greatly appreciated.
I’ve set up a field group to display on a custom taxonomy’s term pages. It’s a repeater field with a few subfields: image, color picker, text and textarea. The problem is that the image and color subfields do not save when I update the term. However, the other fields in the repeater (text and textarea) do save. This is only happening on the term page; everything works fine on pages, posts, etc.
Thanks in advance.
The most likely cause of this is usually conflicts in field names, either with other fields on the same page or with WP reserved words. It you don’t see anything like this.
If it’s ACF5 can you export a json file of your field group and attach it here. It it’s 4, can you do an export of the field group and save it as a text file and attach that. Will make it much easier for me to test it out.
Hey, John. Thanks for taking the time to help me go over this. I’ve attached a copy of the JSON export file. Regarding the field names, I always prefix them so I’m confident that’s not the issue. I’ve been using ACF for quite a while and haven’t yet experienced anything that’s stumped me like this. Hopefully you can catch whatever I may be missing.
Thanks again for your time!
Your field names are too long.
Short answer is to use shorter field names. Your sub fields can be much shorter because sub fields are all prefixed with the repeater field name.
Custom fields for taxonomies stored in options table and the option name column has a max length of 64 characters.
Let’s say that the taxonomy is
category so the field name is prefixed with “category” and the term ID
Then it has a prefix of the repeater field name and the row index, then the field name is added
total 69 characters. The data is being saved but you option name is getting truncated to
category_1_ssfm_slider_slides_0_ssfm_slider_statement_background so when ACF goes to look for the data it can’t find it.
Edit: There is a trac ticket on this and the WP team has been sitting on it for years. We have been pushing to get the lenght of this field increased but they keep putting it off for more important things… well, more important to some.
You must be logged in to reply to this topic.
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!
© 2023 Advanced Custom Fields.