Update_field() not working with Post Object field
-
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:update_field( 'field_xxx', $postid, $targetpostid);
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.
- The topic ‘Update_field() not working with Post Object field’ is closed to new replies.