Hey Micah, ty for post.
I’m developing a frontend application. I’m using this code to add a attachament:
require_once(ABSPATH . 'wp-admin/includes/admin.php');
$id = media_handle_upload($img_up, $post_id);
$info = array();
$info['ID'] = $id;
$info['post_title'] = $post_title;
$info['post_excerpt'] = $post_excerpt;
$info['post_content'] = $post_content;
wp_update_post($info);
Edit all post is easy, but dont know how update only the image via code.