[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fYbu3K3fUXpb93WO-uubGxaExnz3HK19dA41BJcNa5NY":3},{"slug":4,"display_name":4,"profile_url":5,"plugin_count":6,"total_installs":7,"avg_security_score":8,"avg_patch_time_days":9,"trust_score":10,"computed_at":11,"plugins":12},"stianlik","https:\u002F\u002Fprofiles.wordpress.org\u002Fstianlik\u002F",1,1000,85,30,84,"2026-04-04T13:45:50.626Z",[13],{"slug":14,"name":15,"version":16,"author":4,"author_profile":5,"description":17,"short_description":18,"active_installs":7,"downloaded":19,"rating":20,"num_ratings":21,"last_updated":22,"tested_up_to":23,"requires_at_least":24,"requires_php":24,"tags":25,"homepage":24,"download_link":29,"security_score":8,"vuln_count":30,"unpatched_count":30,"last_vuln_date":31,"fetched_at":32},"pdf-thumbnails","PDF Thumbnails","2.2.0","\u003Cp>This plugin hooks into the media manager and generates a thumbnail everytime a\u003Cbr \u002F>\nPDF is uploaded. Generated thumbnail is an image of the first page in the\u003Cbr \u002F>\nuploaded document and is named \u003Ccode>PDFNAME-thumbnail\u003C\u002Fcode>, where \u003Ccode>PDFNAME\u003C\u002Fcode> is replaced\u003Cbr \u002F>\nby uploaded document filename.\u003C\u002Fp>\n\u003Cp>Generated thumbnails are equivalent to \u003Ca href=\"https:\u002F\u002Fcodex.wordpress.org\u002FPost_Thumbnails\" rel=\"nofollow ugc\">featured\u003Cbr \u002F>\nimages\u003C\u002Fa> so that common thumbnail\u003Cbr \u002F>\nfunctions like \u003Ccode>get_post_thumbnail_id()\u003C\u002Fcode> can be used for PDF attachments. See\u003Cbr \u002F>\n\u003Ca href=\"https:\u002F\u002Fcodex.wordpress.org\u002FPost_Thumbnails\" rel=\"nofollow ugc\">Post Thumbnails\u003C\u002Fa> for information\u003Cbr \u002F>\non how you can use thumbnails efficiently.\u003C\u002Fp>\n\u003Cp>Integration with the javascript media API is not yet implemented, therefore, you\u003Cbr \u002F>\nmay need to reload the page before you can see generated thumbnail after an\u003Cbr \u002F>\nupload.\u003C\u002Fp>\n\u003Ch4>Shortcodes\u003C\u002Fh4>\n\u003Cp>It is possible to display a thumbnail linking to an uploaded PDF using the \u003Ccode>[pdf_thumbnails_link]\u003C\u002Fcode>\u003Cbr \u002F>\nshortcode. The following attributes are supported:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>id\u003C\u002Fcode> – Attachment ID (required)\u003C\u002Fli>\n\u003Cli>\u003Ccode>size\u003C\u002Fcode> – \u003Ca href=\"https:\u002F\u002Fcodex.wordpress.org\u002FPost_Thumbnails#Thumbnail_Sizes\" rel=\"nofollow ugc\">Thumbnail size\u003C\u002Fa> (optional)\u003C\u002Fli>\n\u003Cli>\u003Ccode>title\u003C\u002Fcode> – \u003Ca href=\"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTML\u002FGlobal_attributes#attr-title\" rel=\"nofollow ugc\">Anchor title attribute\u003C\u002Fa> (optional)\u003C\u002Fli>\n\u003Cli>\u003Ccode>target\u003C\u002Fcode> – \u003Ca href=\"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTML\u002FElement\u002Fa#attr-target\" rel=\"nofollow ugc\">Anchor target attribute\u003C\u002Fa> (optional)\u003C\u002Fli>\n\u003Cli>\u003Ccode>download\u003C\u002Fcode> – \u003Ca href=\"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTML\u002FElement\u002Fa#attr-download\" rel=\"nofollow ugc\">Anchor download attribute\u003C\u002Fa> (optional)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Example 1: Display link to PDF with ID = 172 using \u003Ca href=\"https:\u002F\u002Fcodex.wordpress.org\u002FPost_Thumbnails#Thumbnail_Sizes\" rel=\"nofollow ugc\">default thumbnail size\u003C\u002Fa>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>[pdf_thumbnails_link id=\"172\"]\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Example 2: Display link to PDF with ID = 172 using thumbnail size (default 150×150)\u003C\u002Fp>\n\u003Cpre>\u003Ccode>[pdf_thumbnails_link id=\"172\" size=\"thumbnail\"]\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Thanks to \u003Ca href=\"https:\u002F\u002Fwordpress.org\u002Fsupport\u002Fprofile\u002Fmirgcire\" rel=\"ugc\">mirgcire\u003C\u002Fa> for providing the first\u003Cbr \u002F>\nversion of the \u003Ccode>[pdf_thumbnails_link]\u003C\u002Fcode> shortcode.\u003C\u002Fp>\n\u003Ch4>Developer API\u003C\u002Fh4>\n\u003Cp>In most cases it should be sufficient to use built-in thumbnail functions from\u003Cbr \u002F>\nthe WordPress API (\u003Ccode>get_post_thumbnail\u003C\u002Fcode> and similar). If you need to modify the\u003Cbr \u002F>\nway thumbnails are generated, you can override image generation with\u003Cbr \u002F>\nthe \u003Ccode>pdf_thumbnails_generate_image_blob\u003C\u002Fcode> filter.\u003C\u002Fp>\n\u003Cp>Example 1: Increase resolution for all generated PDF thumbnails\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F\u002F $blob is the current image blob (defaults to null, can be used for chaining)\n\u002F\u002F $filename is the PDF filename\nadd_action('pdf_thumbnails_generate_image_blob', function ($blob, $filename) {\n    $imagick = new Imagick();\n    $imagick->setResolution(200,200);\n    $imagick->readImage($filename);\n    $imagick->setIteratorIndex(0);\n    $imagick->setImageFormat('jpg');\n    return $imagick->getImageBlob();\n}, 10, 2);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>It is possible to modify generated thumbnail links using the \u003Ccode>pdf_thumbnails_link_shortcode\u003C\u002Fcode>\u003Cbr \u002F>\nfilter. The following attributes are available:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>$html\u003C\u002Fcode> – Generated HTML code to be displayed\u003C\u002Fli>\n\u003Cli>\u003Ccode>$attachmentId\u003C\u002Fcode> – Sanitized ID of the PDF attachment\u003C\u002Fli>\n\u003Cli>\u003Ccode>$size\u003C\u002Fcode> – Sanitized thumbnail size\u003C\u002Fli>\n\u003Cli>\u003Ccode>$atts\u003C\u002Fcode> – \u003Ca href=\"https:\u002F\u002Fcodex.wordpress.org\u002FShortcode_API#Handling_Attributes\" rel=\"nofollow ugc\">Shortcode attributes (not sanitized)\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ccode>$content\u003C\u002Fcode> – Shortcode content (not sanitized)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Example 2: Wrap thumbnail link in figure and append caption\u003C\u002Fp>\n\u003Cpre>\u003Ccode>add_filter('pdf_thumbnails_link_shortcode', function ($html, $attachmentId, $size, $atts, $content) {\n    return \"\u003Cfigure>$html \u003Ccaption>Click to open image $attachmentId\u003C\u002Fcaption>\u003C\u002Ffigure>\";\n}, 10, 5);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>TODO\u003C\u002Fh3>\n\u003Cp>Add generated image to media browser after upload.\u003C\u002Fp>\n\u003Cp>Outline of an implementation based on the javascript media API:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F\u002F New uploads\nwp.Uploader.queue.on('add', function (attachment) {\n\n    if (attachment.subtype !== 'pdf') {\n        return;\n    }\n\n    findThumbnailFor(attachment.ID).then(function (data) {\n\n        \u002F\u002F Add attachment thumbnail to browser\n        var attachment = wp.media.model.Attachment.get(id)\n        attachment.fetch().done(function () {\n            wp.media.editor.open().state().get('library').add(generated attachment)\n        });\n\n    });\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Filter: ajax_query_attachments_args\u003C\u002Fp>\n","This plugin generates a thumbnail everytime you upload a PDF attachment. Generated thumbnail is an image of the first page in uploaded document.",34402,92,9,"2016-10-24T20:49:00.000Z","4.6.30","",[26,27,28],"generator","pdf","thumbnail","https:\u002F\u002Fdownloads.wordpress.org\u002Fplugin\u002Fpdf-thumbnails.2.2.0.zip",0,null,"2026-03-15T15:16:48.613Z"]