I’m having some issues with a plugin I’m writing where no matter what information I feed update_field(), any post object field I attempt to change is unaffected. The field is set up accept the post post type, and is restricted to two categories. It can only accept one post, and null is disallowed. The function looks like this:
I’ve tried passing $postid which has a value of 812 as a string, an integer, an array, and even as a post object by setting $postid = get_post(812). I’ve also verified that the post is in the correct category, yet still, every time I open the target post, the post object field is empty. I’m at a bit of a loss as to where to go from here, so any insight will be greatly appreciated.
I was actually too hasty on this and I can’t edit it anymore. The post object field is accepting the value of $postid formatted as an int, but it’s not displaying in the edit post screen, it’s just showing up as an empty field.
Viewing 4 posts - 1 through 4 (of 4 total)
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