Use wp_update_post()
, not insert
.
wp_update_post(
array(
'ID' => $image_id,
'post_parent' => $new_post_id
)
);
Use wp_update_post()
, not insert
.
wp_update_post(
array(
'ID' => $image_id,
'post_parent' => $new_post_id
)
);