Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ali Irani

    (@airani)

    Hi,
    Please tell me what is os of your server?

    Hi! Have the same issue. No trailing slash added in medialibrary after upload path, thats caused broken images.
    Testing now on localhost, Win11, Apache, php 8.0

    Here a screenshot, how attachment metadata is going to be saved in wp_postmeta table: https://i.imgur.com/XCyIS0E.png

    • This reply was modified 2 years, 12 months ago by Jackky.

    I’m not quite sure about my solution, but this did the trick for me:

    protected function getUploadDir($field)
    {
      if ($this->_uploadDir === null) {
          $this->_uploadDir = wp_upload_dir(date('Y/m', time()));
      }
      return is_array($this->_uploadDir) && array_key_exists($field, $this->_uploadDir) ? trailingslashit( $this->_uploadDir[$field] ) : null;
    }

    Just wrapping up the return of upload dir with trailingslashit func in the file plugins/auto-upload-images/src/ImageUploader.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Uploaded images not showing in the media library’ is closed to new replies.