Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Update_field() not working with Post Object field

$
0
0

Replies: 0

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.

  • This topic was modified 35 minutes ago by rcochran93. Reason: further clarification of issue

Viewing all articles
Browse latest Browse all 59525

Trending Articles