Yes, got the problem. A minute off-track, and it’s wrong! :p
On line 80, 87, 93 and 99 in Pastebin Codes, the syntax of media_handle_upload()
was wrong.
It should be substituted from
media_handle_upload($postid,'product_image_1');
to
media_handle_upload('product_image_1', $postid);
Because the syntax of media_handle_upload()
is:
media_handle_upload( $file_id, $post_id, $post_data, $overrides );
The $post_id
cannot be before $file_id
.