I wrote a simple Wordpress Plugin that upload all images inside a folder located on another server. The uploading process is working well, but for some reason when I go inside Library I have a blank thumbnail:

enter image description here

when I add the file using my own plugin, I also create the post inside the wp_posts table, in this case contains the following info:

enter image description here

and inside the wp_postmeta table I have the following:

enter image description here

is there any reason why the thumbnail isn't showing up? Kind regards.

  • 2
    Do you also use wp_generate_attachment_metadata() to generate the thumbnails for the uploaded media?
    – Jack Johansson
    Oct 31 '19 at 14:09
  • Are you sure you've properly set the upload directory? That's usually the issue in these cases. But also make sure you're using wp_generate_attachment_metadata() otherwise the thumbnail won't be created, file size isn't calculated and so on.
    – Athoxx
    Oct 31 '19 at 15:27
  • @JackJohansson I didn't called that method, but the problem is another now: this plugin isn't installed on wordpress but it's an API which runs on another server, so how can I call the method required by wordpress from an external code?
    – sfarzoso
    Nov 1 '19 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.