Add a image to a post published on a CPT from the front-end
After two days looking for the solution and fighting with the code, I found the solution: As I suspected, the problem was reading the file ($image_data = file_get_contents($image);). The first error was not included in the form enctype =” multipart / form-data ” to send files and data simultaneously. The second error was that images … Read more