I have a CPT with various ACF fields, including taxonomy and file. You can see it in action at: http://oicjapan.org/message (Yeah, I’m developing a live site – I have no choice.) A few of the posts (one in English and about ten in Japanese, even though they are supposed to be identical duplicates – go figure!) act differently than the rest. Normally get_field() on a taxonomy is an object and get_field() on a file type is a string (the URL to the file). But in the case of the weird posts, get_field(taxonomy) is just an integer of the taxonomy ID, and get_field(file) is an array! Here are real var_dump’s from inside the post loop, for an example normal post and an example weird one:
A normal one is ID#4938 – Taxonomy get_field(‘preacher’,4938) looks like this:
Anytime a post has this hiccup, all taxonomy fields and all file fields act this way – it is consistent within a given post.
Since there are only a few weird ones, I assume I can just make them again from scratch, but soon I’ll be mostly entrusting the site maintenance to non-techies, so I would like to know what is causing it so that I can prevent it either by code or training.
Viewing 1 post (of 1 total)
The topic ‘Some posts hiccup with a different ACF structure’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users