• Resolved Rtransat

    (@rtransat)


    Hi,

    It’s possible to integrate the preview from the image in admin thumbnail block after upload ?

    Because, if we use the get_the_post_thumbnail($attachment_id) function in theme, in the admin post edit, we don’t know if the post have some thumbnails.

    I try something in your plugin :

    Replace the line :

    update_post_meta($attachmentId, '_thumbnail_id', $thumbnailId);

    by

    update_post_meta($pdfAttachment->post_parent, '_thumbnail_id', $thumbnailId);

    After upload I close the popin, I click post “Update” button and the preview is showing in the thumbnail block. But how can we do the same and reloading (with ajax) only the thumbnail block after upload ?

    Regards.

    https://www.ads-software.com/plugins/pdf-thumbnails/

Viewing 1 replies (of 1 total)
  • Plugin Author stianlik

    (@stianlik)

    Hi,

    It should be possible, I have some related notes in Other Notes. To make this work without a page refresh, we need to hook into the JavaScript API and update the media browser. I’m working on a solution, but at this point the API is poorly documented and I’m required to read through the core source code to get useful information. It will take me some time to figure out how this API can be utilized efficiently / correctly. You’re welcome to contribute if you find a good way to update the media browser ??

    The plugin does not automatically add PDF thumbnails to your posts, it generate an image of the PDF which is used as thumbnail for the actual PDF attachment. If you would like the thumbnail attached as a featured image to a normal post, you need to do that explicitly using the following steps:

    1. Upload file to post
    2. Refresh page
    3. Choose the generated thumbnail as featured image

    Alternatively, you can automatically display thumbnails for all PDFs uploaded with the method described in this support thread: where and how to put in that magic snippet?.

    Best Regards,
    Stian

Viewing 1 replies (of 1 total)
  • The topic ‘Add preview in admin’ is closed to new replies.