Thanks, that helped me figure out how to add the file to wordpress. I just can’t seem to figure out how to attach it to a post. I have the post object, how can I attach an image to it? Thanks.
users are able to generate images that are then posted to the site.
You’ll need to give us more than that. We need details…
I don’t see how that’s relevant. All I’m trying to figure out is how to attach an attachment to a post when I have the post object and the attachment id. Currently, the post appears without the image, and the image says “unattached” in the Media dashboard.
It looks like the problem is that ‘_wp_attached_file’ and ‘_wp_attachment_metadata’ aren’t generated for the image. How can I manually generate these?
OK, found the problem. I was using $post->ID
for post id parameters instead of just $post
. It’s working now.