{"id":19647,"date":"2012-08-25T17:22:08","date_gmt":"2012-08-25T17:22:08","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/document-gallery\/"},"modified":"2025-12-09T01:05:39","modified_gmt":"2025-12-09T01:05:39","slug":"document-gallery","status":"publish","type":"plugin","link":"https:\/\/mn.wordpress.org\/plugins\/document-gallery\/","author":8600417,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"5.1.0","stable_tag":"5.1.0","tested":"6.9.4","requires":"6.1","requires_php":"5.6","requires_plugins":null,"header_name":"Document Gallery","header_author":"Dan Rossiter","header_description":"","assets_banners_color":"","last_updated":"2025-12-09 01:05:39","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/donate\/?business=EE5LWRLG933EN&no_recurring=0&item_name=Powering+9%2C000%2B+sites+for+free.+Support+continued+development%2C+new+features%2C+and+reliable+maintenance.+Every+dollar+counts%21&currency_code=USD","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/document-gallery\/","header_author_uri":"https:\/\/www.linkedin.com\/in\/danrossiter\/","rating":4.8,"author_block_rating":0,"active_installs":9000,"downloads":321319,"num_ratings":112,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.8":{"tag":"0.8","author":"dan.rossiter","date":"2014-10-22 00:38:47"},"0.8.5":{"tag":"0.8.5","author":"dan.rossiter","date":"2014-10-22 00:38:47"},"1.0":{"tag":"1.0","author":"dan.rossiter","date":"2013-01-06 17:04:05"},"1.0.1":{"tag":"1.0.1","author":"dan.rossiter","date":"2013-01-06 17:04:05"},"1.0.2":{"tag":"1.0.2","author":"dan.rossiter","date":"2013-01-06 17:08:19"},"1.0.3":{"tag":"1.0.3","author":"dan.rossiter","date":"2013-01-11 04:18:42"},"1.0.4":{"tag":"1.0.4","author":"dan.rossiter","date":"2013-01-12 12:38:39"},"1.1":{"tag":"1.1","author":"dan.rossiter","date":"2013-01-13 02:47:45"},"1.2":{"tag":"1.2","author":"dan.rossiter","date":"2013-01-18 00:24:25"},"1.2.1":{"tag":"1.2.1","author":"dan.rossiter","date":"2013-01-20 22:20:59"},"1.3":{"tag":"1.3","author":"dan.rossiter","date":"2013-02-08 20:21:30"},"1.3.1":{"tag":"1.3.1","author":"dan.rossiter","date":"2013-02-09 03:22:20"},"1.4":{"tag":"1.4","author":"dan.rossiter","date":"2013-12-31 01:10:15"},"1.4.1":{"tag":"1.4.1","author":"dan.rossiter","date":"2013-12-31 01:10:15"},"1.4.2":{"tag":"1.4.2","author":"dan.rossiter","date":"2013-12-31 01:10:15"},"1.4.3":{"tag":"1.4.3","author":"dan.rossiter","date":"2013-12-31 01:10:15"},"2.0":{"tag":"2.0","author":"dan.rossiter","date":"2014-03-22 16:04:22"},"2.0.1":{"tag":"2.0.1","author":"dan.rossiter","date":"2014-03-23 16:40:49"},"2.0.10":{"tag":"2.0.10","author":"dan.rossiter","date":"2014-05-22 02:58:21"},"2.0.2":{"tag":"2.0.2","author":"dan.rossiter","date":"2014-03-28 05:06:32"},"2.0.3":{"tag":"2.0.3","author":"dan.rossiter","date":"2014-04-01 04:24:02"},"2.0.4":{"tag":"2.0.4","author":"dan.rossiter","date":"2014-04-03 00:22:21"},"2.0.5":{"tag":"2.0.5","author":"dan.rossiter","date":"2014-04-04 02:16:42"},"2.0.6":{"tag":"2.0.6","author":"dan.rossiter","date":"2014-04-10 01:47:50"},"2.0.7":{"tag":"2.0.7","author":"dan.rossiter","date":"2014-04-10 23:38:15"},"2.0.8":{"tag":"2.0.8","author":"dan.rossiter","date":"2014-04-15 03:00:55"},"2.0.9":{"tag":"2.0.9","author":"dan.rossiter","date":"2014-04-21 03:05:43"},"2.1":{"tag":"2.1","author":"dan.rossiter","date":"2014-06-04 00:14:54"},"2.1.1":{"tag":"2.1.1","author":"dan.rossiter","date":"2014-10-22 00:38:47"},"2.2":{"tag":"2.2","author":"dan.rossiter","date":"2014-09-30 18:31:34"},"2.2.1":{"tag":"2.2.1","author":"dan.rossiter","date":"2014-10-01 06:57:50"},"2.2.2":{"tag":"2.2.2","author":"dan.rossiter","date":"2014-10-01 16:08:24"},"2.2.3":{"tag":"2.2.3","author":"dan.rossiter","date":"2014-10-11 04:06:40"},"2.2.4":{"tag":"2.2.4","author":"dan.rossiter","date":"2014-10-14 06:09:44"},"2.2.5":{"tag":"2.2.5","author":"dan.rossiter","date":"2014-10-18 21:07:01"},"2.2.6":{"tag":"2.2.6","author":"dan.rossiter","date":"2014-10-22 00:38:47"},"2.2.7":{"tag":"2.2.7","author":"dan.rossiter","date":"2014-11-06 01:24:01"},"2.3":{"tag":"2.3","author":"dan.rossiter","date":"2014-12-14 18:43:07"},"2.3.1":{"tag":"2.3.1","author":"dan.rossiter","date":"2014-12-14 19:21:14"},"2.3.2":{"tag":"2.3.2","author":"dan.rossiter","date":"2014-12-14 19:37:18"},"2.3.3":{"tag":"2.3.3","author":"dan.rossiter","date":"2014-12-15 02:24:06"},"2.3.4":{"tag":"2.3.4","author":"dan.rossiter","date":"2014-12-16 01:03:32"},"2.3.5":{"tag":"2.3.5","author":"dan.rossiter","date":"2014-12-24 00:45:13"},"2.3.6":{"tag":"2.3.6","author":"dan.rossiter","date":"2014-12-31 03:24:48"},"2.3.7":{"tag":"2.3.7","author":"dan.rossiter","date":"2015-01-05 06:14:44"},"3.0":{"tag":"3.0","author":"dan.rossiter","date":"2015-03-13 00:42:21"},"3.0.0-beta":{"tag":"3.0.0-beta","author":"dan.rossiter","date":"2015-02-21 02:17:01"},"3.0.1":{"tag":"3.0.1","author":"dan.rossiter","date":"2015-03-13 01:04:01"},"3.0.2":{"tag":"3.0.2","author":"dan.rossiter","date":"2015-03-17 00:07:05"},"3.1":{"tag":"3.1","author":"dan.rossiter","date":"2015-05-24 01:01:57"},"3.2":{"tag":"3.2","author":"demur","date":"2015-06-04 05:00:45"},"3.3":{"tag":"3.3","author":"demur","date":"2015-06-22 20:15:47"},"3.3.1":{"tag":"3.3.1","author":"dan.rossiter","date":"2015-06-23 03:14:00"},"3.4.1":{"tag":"3.4.1","author":"dan.rossiter","date":"2015-09-19 16:59:59"},"3.4.2":{"tag":"3.4.2","author":"dan.rossiter","date":"2015-09-20 18:24:19"},"3.5":{"tag":"3.5","author":"dan.rossiter","date":"2015-10-06 02:39:31"},"3.5.1":{"tag":"3.5.1","author":"dan.rossiter","date":"2015-10-06 04:22:20"},"3.5.2":{"tag":"3.5.2","author":"dan.rossiter","date":"2015-10-21 03:41:47"},"3.5.3":{"tag":"3.5.3","author":"dan.rossiter","date":"2015-11-14 20:23:24"},"3.5.4":{"tag":"3.5.4","author":"dan.rossiter","date":"2015-11-21 11:00:21"},"4.0":{"tag":"4.0","author":"dan.rossiter","date":"2015-11-27 02:01:16"},"4.1":{"tag":"4.1","author":"dan.rossiter","date":"2015-12-19 08:26:33"},"4.1.1":{"tag":"4.1.1","author":"dan.rossiter","date":"2015-12-19 08:40:02"},"4.1.10":{"tag":"4.1.10","author":"dan.rossiter","date":"2016-01-08 01:50:20"},"4.1.11":{"tag":"4.1.11","author":"dan.rossiter","date":"2016-01-26 05:57:52"},"4.1.12":{"tag":"4.1.12","author":"dan.rossiter","date":"2016-02-06 23:10:59"},"4.1.13":{"tag":"4.1.13","author":"dan.rossiter","date":"2016-02-20 02:10:45"},"4.1.14":{"tag":"4.1.14","author":"dan.rossiter","date":"2016-02-20 19:47:41"},"4.1.2":{"tag":"4.1.2","author":"dan.rossiter","date":"2015-12-19 23:10:30"},"4.1.3":{"tag":"4.1.3","author":"dan.rossiter","date":"2015-12-19 22:49:04"},"4.1.4":{"tag":"4.1.4","author":"dan.rossiter","date":"2015-12-22 18:04:00"},"4.1.5":{"tag":"4.1.5","author":"dan.rossiter","date":"2015-12-22 07:34:59"},"4.1.6":{"tag":"4.1.6","author":"dan.rossiter","date":"2015-12-24 00:01:02"},"4.1.7":{"tag":"4.1.7","author":"dan.rossiter","date":"2015-12-29 01:42:52"},"4.1.8":{"tag":"4.1.8","author":"dan.rossiter","date":"2016-01-01 01:09:51"},"4.1.9":{"tag":"4.1.9","author":"dan.rossiter","date":"2016-01-03 00:04:23"},"4.2":{"tag":"4.2","author":"dan.rossiter","date":"2016-03-18 01:23:28"},"4.2.1":{"tag":"4.2.1","author":"dan.rossiter","date":"2016-03-31 16:16:24"},"4.2.2":{"tag":"4.2.2","author":"dan.rossiter","date":"2016-04-06 02:10:46"},"4.2.3":{"tag":"4.2.3","author":"dan.rossiter","date":"2016-05-29 04:48:58"},"4.2.4":{"tag":"4.2.4","author":"dan.rossiter","date":"2016-08-16 02:13:40"},"4.2.5":{"tag":"4.2.5","author":"dan.rossiter","date":"2016-08-29 23:06:57"},"4.2.6":{"tag":"4.2.6","author":"dan.rossiter","date":"2016-10-02 19:53:47"},"4.3.1":{"tag":"4.3.1","author":"dan.rossiter","date":"2016-12-11 00:52:51"},"4.3.2":{"tag":"4.3.2","author":"dan.rossiter","date":"2017-05-02 03:47:47"},"4.4":{"tag":"4.4","author":"dan.rossiter","date":"2017-05-17 05:52:48"},"4.4.1":{"tag":"4.4.1","author":"dan.rossiter","date":"2017-06-08 06:14:14"},"4.4.2":{"tag":"4.4.2","author":"dan.rossiter","date":"2017-07-22 21:45:59"},"4.4.3":{"tag":"4.4.3","author":"dan.rossiter","date":"2017-11-12 15:20:51"},"4.4.4":{"tag":"4.4.4","author":"dan.rossiter","date":"2023-12-01 03:45:24"},"5.0.0":{"tag":"5.0.0","author":"dan.rossiter","date":"2025-12-08 11:47:32"},"5.1.0":{"tag":"5.1.0","author":"dan.rossiter","date":"2025-12-09 01:05:39"}},"upgrade_notice":[],"ratings":{"1":4,"2":0,"3":1,"4":10,"5":97},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":983329,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":983329,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":983329,"resolution":false,"location":"assets","locale":false}},"assets_banners":[],"assets_blueprints":{"blueprint.json":{"filename":"blueprint.json","revision":3414845,"resolution":false,"location":"assets","locale":"","contents":"{\"$schema\":\"https:\\\/\\\/playground.wordpress.net\\\/blueprint-schema.json\",\"landingPage\":\"\\\/wp-admin\\\/post-new.php?post_type=page\",\"preferredVersions\":{\"php\":\"8.0\",\"wp\":\"latest\"},\"phpExtensionBundles\":[\"kitchen-sink\"],\"features\":{\"networking\":true},\"steps\":[{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"document-gallery\"},\"options\":{\"activate\":true}},{\"step\":\"activatePlugin\",\"pluginPath\":\"document-gallery\\\/document-gallery.php\"},{\"step\":\"runPHP\",\"code\":\"<?php require_once 'wordpress\\\/wp-load.php'; wp_set_current_user(1); $attachment_ids = []; $files = [ ['title' => 'Sample Report 2024', 'filename' => 'report-2024.pdf'], ['title' => 'Company Presentation', 'filename' => 'presentation.pdf'], ['title' => 'Technical Documentation', 'filename' => 'docs.pdf'], ['title' => 'Meeting Minutes Q4', 'filename' => 'minutes-q4.pdf'] ]; $upload_dir = wp_upload_dir(); foreach ($files as $file) { $filepath = $upload_dir['path'] . '\\\/' . $file['filename']; $pdf_content = '%PDF-1.4\\n1 0 obj\\n<<\\n\\\/Type \\\/Catalog\\n\\\/Pages 2 0 R\\n>>\\nendobj\\n2 0 obj\\n<<\\n\\\/Type \\\/Pages\\n\\\/Kids [3 0 R]\\n\\\/Count 1\\n>>\\nendobj\\n3 0 obj\\n<<\\n\\\/Type \\\/Page\\n\\\/Parent 2 0 R\\n\\\/Resources <<\\n\\\/Font <<\\n\\\/F1 4 0 R\\n>>\\n>>\\n\\\/MediaBox [0 0 612 792]\\n\\\/Contents 5 0 R\\n>>\\nendobj\\n4 0 obj\\n<<\\n\\\/Type \\\/Font\\n\\\/Subtype \\\/Type1\\n\\\/BaseFont \\\/Helvetica\\n>>\\nendobj\\n5 0 obj\\n<<\\n\\\/Length 44\\n>>\\nstream\\nBT\\n\\\/F1 24 Tf\\n100 700 Td\\n(' . $file['title'] . ') Tj\\nET\\nendstream\\nendobj\\nxref\\n0 6\\n0000000000 65535 f\\n0000000009 00000 n\\n0000000058 00000 n\\n0000000115 00000 n\\n0000000261 00000 n\\n0000000340 00000 n\\ntrailer\\n<<\\n\\\/Size 6\\n\\\/Root 1 0 R\\n>>\\nstartxref\\n433\\n%%EOF'; file_put_contents($filepath, $pdf_content); $attachment = [ 'guid' => $upload_dir['url'] . '\\\/' . basename($filepath), 'post_mime_type' => 'application\\\/pdf', 'post_title' => $file['title'], 'post_content' => '', 'post_status' => 'inherit' ]; $attach_id = wp_insert_attachment($attachment, $filepath); require_once(ABSPATH . 'wp-admin\\\/includes\\\/image.php'); $attach_data = wp_generate_attachment_metadata($attach_id, $filepath); wp_update_attachment_metadata($attach_id, $attach_data); $attachment_ids[] = $attach_id; } update_option('dg_demo_attachment_ids', $attachment_ids);\"},{\"step\":\"runPHP\",\"code\":\"<?php require_once 'wordpress\\\/wp-load.php'; wp_set_current_user(1); $page_content = '<!-- wp:heading -->\\n<h2 class=\\\"wp-block-heading\\\">Welcome to Document Gallery<\\\/h2>\\n<!-- \\\/wp:heading -->\\n\\n<!-- wp:paragraph -->\\n<p>This demo showcases how Document Gallery displays your documents in a beautiful, gallery-style format. Below you will see automatically generated thumbnails for PDF files.<\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:heading {\\\"level\\\":3} -->\\n<h3 class=\\\"wp-block-heading\\\">Sample Document Library<\\\/h3>\\n<!-- \\\/wp:heading -->\\n\\n<!-- wp:document-gallery\\\/document-gallery {\\\"columns\\\":3,\\\"fancy\\\":true,\\\"descriptions\\\":true} \\\/-->\\n\\n<!-- wp:heading {\\\"level\\\":3} -->\\n<h3 class=\\\"wp-block-heading\\\">Features<\\\/h3>\\n<!-- \\\/wp:heading -->\\n\\n<!-- wp:list -->\\n<ul class=\\\"wp-block-list\\\"><!-- wp:list-item -->\\n<li><strong>Automatic Thumbnails<\\\/strong> - Generates preview images instead of generic icons<\\\/li>\\n<!-- \\\/wp:list-item -->\\n\\n<!-- wp:list-item -->\\n<li><strong>Multiple Layouts<\\\/strong> - Grid or list view with customizable columns<\\\/li>\\n<!-- \\\/wp:list-item -->\\n\\n<!-- wp:list-item -->\\n<li><strong>Smart Filtering<\\\/strong> - Display all attachments or filter by post\\\/page<\\\/li>\\n<!-- \\\/wp:list-item -->\\n\\n<!-- wp:list-item -->\\n<li><strong>Flexible Display<\\\/strong> - Show descriptions, control sorting, and open in new window<\\\/li>\\n<!-- \\\/wp:list-item --><\\\/ul>\\n<!-- \\\/wp:list -->\\n\\n<!-- wp:paragraph -->\\n<p>Click any document thumbnail to open the file!<\\\/p>\\n<!-- \\\/wp:paragraph -->'; $page_id = wp_insert_post([ 'post_title' => 'Document Gallery Demo', 'post_content' => $page_content, 'post_status' => 'publish', 'post_type' => 'page' ]); update_option('page_on_front', $page_id); update_option('show_on_front', 'page');\"},{\"step\":\"runPHP\",\"code\":\"<?php require_once 'wordpress\\\/wp-load.php'; if (extension_loaded('imagick')) { $dg_options = get_option('document_gallery', []); if (!isset($dg_options['thumber'])) { $dg_options['thumber'] = []; } if (!isset($dg_options['thumber']['active'])) { $dg_options['thumber']['active'] = []; } $dg_options['thumber']['active']['imagick'] = true; $dg_options['thumber']['active']['gs'] = false; $dg_options['thumber']['active']['av'] = false; if (!isset($dg_options['gallery'])) { $dg_options['gallery'] = []; } $dg_options['gallery']['fancy'] = true; update_option('document_gallery', $dg_options); }\"}]}"}},"all_blocks":{"document-gallery\/document-gallery-block":{"$schema":"https:\/\/schemas.wp.org\/trunk\/block.json","apiVersion":2,"name":"document-gallery\/document-gallery-block","version":"0.1.0","title":"Document Gallery","category":"widgets","icon":"media-archive","attributes":{"ids":{"type":"string"},"columns":{"type":"number"},"fancy":{"type":"boolean"},"relation":{"type":"string"},"limit":{"type":"number"},"mime_types":{"type":"string"},"post_status":{"type":"string"},"post_type":{"type":"string"},"attachment_pg":{"type":"boolean"},"descriptions":{"type":"boolean"},"new_window":{"type":"boolean"},"paginate":{"type":"boolean"},"order":{"type":"string"},"orderby":{"type":"string"},"localpost":{"type":"boolean","default":false}},"description":"Block to display a document gallery.","example":{},"supports":{"html":false},"textdomain":"document-gallery","editorScript":"file:.\/index.js","editorStyle":"file:.\/index.css","style":"file:.\/style-index.css","viewScript":"file:.\/view.js"}},"tagged_versions":["0.8","0.8.5","1.0","1.0.1","1.0.2","1.0.3","1.0.4","1.1","1.2","1.2.1","1.3","1.3.1","1.4","1.4.1","1.4.2","1.4.3","2.0","2.0.1","2.0.10","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1","2.1.1","2.2","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.2.6","2.2.7","2.3","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","3.0","3.0.0-beta","3.0.1","3.0.2","3.1","3.2","3.3","3.3.1","3.4.1","3.4.2","3.5","3.5.1","3.5.2","3.5.3","3.5.4","4.0","4.1","4.1.1","4.1.10","4.1.11","4.1.12","4.1.13","4.1.14","4.1.2","4.1.3","4.1.4","4.1.5","4.1.6","4.1.7","4.1.8","4.1.9","4.2","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.3.1","4.3.2","4.4","4.4.1","4.4.2","4.4.3","4.4.4","5.0.0","5.1.0"],"block_files":[],"assets_screenshots":{"screenshot-4.png":{"filename":"screenshot-4.png","revision":3414845,"resolution":"4","location":"plugin"},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3414845,"resolution":"5","location":"plugin"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3414845,"resolution":"2","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":3414845,"resolution":"1","location":"plugin"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3414845,"resolution":"3","location":"plugin"}},"screenshots":{"1":"All gallery options are accessible through the block settings sidebar,\nwith real-time preview updates as you make changes.","2":"Document Gallery integrates seamlessly with the WordPress Block Editor,\nproviding an intuitive interface for creating and configuring galleries.","3":"This is an example of \"fancy\" thumbnails. The images are a copy of the front\npage for each document.","4":"This is an example of multiple Document Galleries on a single page (using\nthe <code>ids<\/code> attribute). It also shows how images will appear in a Document\nGallery. Note that the description field supports HTML markup, so the\npossibilities are endless!","5":"This is how the Document Gallery looks with <code>descriptions=false<\/code> (default).\nNote that the display inherits styling from your active theme."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1346,9054,1980,1764,6585],"plugin_category":[50],"plugin_contributors":[79263,79264],"plugin_business_model":[],"class_list":["post-19647","plugin","type-plugin","status-publish","hentry","plugin_tags-attachments","plugin_tags-documents","plugin_tags-library","plugin_tags-pdf","plugin_tags-word","plugin_category-media","plugin_contributors-danrossiter","plugin_contributors-demur","plugin_committers-danrossiter","plugin_committers-demur"],"banners":[],"icons":{"svg":"https:\/\/ps.w.org\/document-gallery\/assets\/icon.svg?rev=983329","icon":"https:\/\/ps.w.org\/document-gallery\/assets\/icon.svg?rev=983329","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/document-gallery\/trunk\/screenshot-1.png?rev=3414845","caption":"All gallery options are accessible through the block settings sidebar,\nwith real-time preview updates as you make changes."},{"src":"https:\/\/ps.w.org\/document-gallery\/trunk\/screenshot-2.png?rev=3414845","caption":"Document Gallery integrates seamlessly with the WordPress Block Editor,\nproviding an intuitive interface for creating and configuring galleries."},{"src":"https:\/\/ps.w.org\/document-gallery\/trunk\/screenshot-3.png?rev=3414845","caption":"This is an example of \"fancy\" thumbnails. The images are a copy of the front\npage for each document."},{"src":"https:\/\/ps.w.org\/document-gallery\/trunk\/screenshot-4.png?rev=3414845","caption":"This is an example of multiple Document Galleries on a single page (using\nthe <code>ids<\/code> attribute). It also shows how images will appear in a Document\nGallery. Note that the description field supports HTML markup, so the\npossibilities are endless!"},{"src":"https:\/\/ps.w.org\/document-gallery\/trunk\/screenshot-5.png?rev=3414845","caption":"This is how the Document Gallery looks with <code>descriptions=false<\/code> (default).\nNote that the display inherits styling from your active theme."}],"raw_content":"<!--section=description-->\n<p>Display your documents beautifully! Document Gallery creates thumbnail galleries for PDFs, Word documents, PowerPoint presentations, and other file types\u2014just like WordPress does for images.<\/p>\n\n<h4>Key Features<\/h4>\n\n<ul>\n<li><strong>WordPress Block Editor<\/strong> - Insert galleries with a single click, configure visually<\/li>\n<li><strong>Automatic Thumbnails<\/strong> - Generates preview images for documents (PDF, Office files, etc.)<\/li>\n<li><strong>Modern Image Formats<\/strong> - Full support for WebP and AVIF images (WordPress 6.5+)<\/li>\n<li><strong>Flexible Display<\/strong> - Grid or list layout with optional descriptions<\/li>\n<li><strong>Smart Filtering<\/strong> - Show all attachments, current post only, or specific documents<\/li>\n<li><strong>Pagination Support<\/strong> - Handle large document libraries efficiently<\/li>\n<li><strong>Fully Customizable<\/strong> - Control columns, sorting, links, and styling<\/li>\n<li><strong>Classic Shortcode<\/strong> - <code>[dg]<\/code> shortcode available for template use<\/li>\n<\/ul>\n\n<h4>Perfect For<\/h4>\n\n<ul>\n<li>Document libraries and resource centers<\/li>\n<li>Portfolio and work sample galleries<\/li>\n<li>Publication and whitepaper collections<\/li>\n<li>Course materials and downloads<\/li>\n<li>Legal document repositories<\/li>\n<\/ul>\n\n<h4>Block Editor Integration<\/h4>\n\n<p>Click the '+' button in the editor and search for \"Document Gallery\" to insert a gallery block. All configuration options appear in the sidebar\u2014no shortcode knowledge required. Select specific documents or let the gallery auto-populate based on your criteria.<\/p>\n\n<h4>Shortcode Support<\/h4>\n\n<p>The classic <code>[dg]<\/code> shortcode continues to work perfectly for template files, widgets, and power users who prefer code-based configuration. See the Installation tab for all available options.<\/p>\n\n<h4>Developer Friendly<\/h4>\n\n<p>Document Gallery provides extensive filters and actions for customizing thumbnail generation, HTML output, and gallery queries. See the Installation tab for complete developer documentation.<\/p>\n\n<h4>Partners<\/h4>\n\n<ul>\n<li><strong>WP Real Media Library<\/strong>: Document Gallery seamlessly integrates with RML by way of a\n<a href=\"https:\/\/wordpress.org\/plugins\/dg-real-media-library\/\">helper plugin<\/a>.<\/li>\n<\/ul>\n\n<h4>Translation<\/h4>\n\n<p>Document Gallery has to-date been translated into <strong>6<\/strong> languages, listed below.<\/p>\n\n<ul>\n<li><strong>Finnish<\/strong> &#8212; <em>Thanks, <a href=\"https:\/\/wordpress.org\/support\/profile\/villevetela\">villevetela<\/a>!<\/em><\/li>\n<li><strong>French<\/strong> &#8212; <em>Thanks, Marc Liotard and <a href=\"http:\/\/www.trafic-influence.com\/\">Traffic Influence<\/a>!<\/em><\/li>\n<li><strong>Russian<\/strong> &#8212; <em>Thanks, <a href=\"http:\/\/wordpress.org\/support\/profile\/demur\">demur<\/a>!<\/em><\/li>\n<li><strong>Spanish<\/strong> &#8212; <em>Thanks, Andrew Kurtis and <a href=\"http:\/\/www.webhostinghub.com\/\">WebHostingHub<\/a>!<\/em><\/li>\n<li><strong>Swedish<\/strong> &#8212; <em>Thanks, <a href=\"http:\/\/wordpress.org\/support\/profile\/mepmepmep\">mepmepmep<\/a>!<\/em><\/li>\n<li><strong>Ukrainian<\/strong> &#8212; <em>Thanks, <a href=\"http:\/\/wordpress.org\/support\/profile\/demur\">demur<\/a>!<\/em><\/li>\n<\/ul>\n\n<h4>Developers<\/h4>\n\n<p>Document Gallery includes features intended to make integration with other plugins\nsimple. See the bottom of the <strong>Installation<\/strong> tab for specific documentation on\nthe various features provided.<\/p>\n\n<p><em>If this plugin has helped you, please take a moment to <a href=\"http:\/\/wordpress.org\/support\/view\/plugin-reviews\/document-gallery#postform\">rate it<\/a>!<\/em><\/p>\n\n<!--section=installation-->\n<h4>Automatic Installation<\/h4>\n\n<ol>\n<li>Go to Plugins &gt; Add New in your WordPress admin<\/li>\n<li>Search for \"Document Gallery\"<\/li>\n<li>Click Install Now, then Activate<\/li>\n<\/ol>\n\n<h4>Getting Started<\/h4>\n\n<p><strong>Block Editor (Recommended)<\/strong><\/p>\n\n<ol>\n<li>Create or edit a post\/page<\/li>\n<li>Click the '+' button and search for \"Document Gallery\"<\/li>\n<li>Insert the block and configure options in the sidebar<\/li>\n<li>Optionally select specific documents, or let it auto-populate<\/li>\n<\/ol>\n\n<p><strong>Shortcode Method<\/strong><\/p>\n\n<p>Add <code>[dg]<\/code> to any post, page, or text widget. See Document Gallery Options below for configuration.<\/p>\n\n<h4>Manual Installation<\/h4>\n\n<ol>\n<li>Download the plugin from WordPress.org<\/li>\n<li>Upload the <code>document-gallery<\/code> folder to <code>\/wp-content\/plugins\/<\/code><\/li>\n<li>Activate through the Plugins menu<\/li>\n<\/ol>\n\n<h4>Document Gallery Options<\/h4>\n\n<p>In order to include all compatible documents from a given page or post, you\nmust include the following shortcode in the post: <code>[dg]<\/code>.<\/p>\n\n<p>In addition to the default behavior, the plugin provides many options to\ncustomize behavior with various attributes, some of which are shown below:<\/p>\n\n<pre><code>[dg [fancy=&lt;true\/false&gt;] [attachment_pg=&lt;true\/false&gt;] [descriptions=&lt;true\/false&gt;] [order=&lt;ASC\/DESC&gt;] [orderby=&lt;**see below**&gt;]]\n<\/code><\/pre>\n\n<p>Though the shortcode above may seem far from \"short,\" none of the attributes are\nrequired and most users will find that the plugin meets your needs \"out of the box\"\nwithout any added attributes.<\/p>\n\n<p><strong>Default Values<\/strong><\/p>\n\n<p>Default document gallery behavior can be configured in your dashboard under <code>Settings -&gt; Document Gallery<\/code>.<\/p>\n\n<p><strong>Attachment Page Option<\/strong> <em>(New in Version 1.1)<\/em><\/p>\n\n<p>This option determines whether each document icon will link to the actual file\nor to its attachment page.  If you want the user to be able to click on the\nicon and directly receive the option to download then use <code>attachment_pg=false<\/code>\n(the default). If you have information on the attachment page that you want the\nlink to go to, use <code>attachment_pg=true<\/code>.<\/p>\n\n<p><strong>Categories\/Custom Taxonomy Option<\/strong> <em>(New in Version 1.4)<\/em><\/p>\n\n<p>With the <code>categories<\/code> option you are able to select attachments based on\ntheir assigned category or any other\n<a href=\"http:\/\/codex.wordpress.org\/Taxonomies\">custom taxon<\/a>. Categories\nor any custom taxon can be referenced simply by including <code>category=category_value<\/code>\nor <code>taxon_name=taxon_value<\/code>. Multiple values for a single taxon may be separated\nby commas. Note that if a taxon value contains spaces then the entire comma-\ndelimited list must be quoted.<\/p>\n\n<p><strong>Columns Option<\/strong> <em>(New in Version 3.0)<\/em><\/p>\n\n<p>The columns option does what it sounds like -- sets how many columns to use in\nrendering your gallery. With <code>columns=-1<\/code>, you will get an infinite number of\ncolumns. In other words, only 1 row with all icons.<\/p>\n\n<p><strong>Descriptions Option<\/strong><\/p>\n\n<p>If <code>true<\/code>, each document will take its own line with the description displayed\nalongside it.<\/p>\n\n<p><em>Note: this will use the <code>description<\/code> field, <strong>not<\/strong> the <code>caption<\/code>. Be\ncareful when entering your document data.<\/em><\/p>\n\n<p><strong>Fancy Option<\/strong> <em>(New in Version 2.0)<\/em><\/p>\n\n<p>If <code>true<\/code>, we will try to generate a thumbnail for each document in the gallery.\nThe success in generating thumbs will depend mostly on what your server supports.\nTo fine-tune how thumbnails are generated, visit <code>Settings -&gt; Document Gallery<\/code>\nin your site's dashboard.<\/p>\n\n<p><strong>ID Option<\/strong> <em>(New in Version 3.0)<\/em><\/p>\n\n<p>This option indicates from which parent post\/page to retrieve attachments.\nIf not explicitly set, the default will be the post\/page where the shortcode\nis being used.<\/p>\n\n<p>If you do not wish to filter by parent, <code>id=-1<\/code> will match all attachments.<\/p>\n\n<p><strong>IDs Option<\/strong> <em>(New in Version 1.2)<\/em><\/p>\n\n<p>This is an advanced option intended for experienced WordPress users. If this\noption is used, the plugin will ignore attached documents, instead including\nall attachments defined by the <code>ids<\/code> attribute (e.g.: <code>ids=10,2,4,42<\/code>).<\/p>\n\n<p><em>Note: If this attribute is used, order defaults to the order of IDs given\nrather than menu_order unless order is explicitly stated.<\/em><\/p>\n\n<p><strong>Images Option<\/strong> <em>(New in Version 1.2)<\/em><\/p>\n\n<p>This option will tell the plugin to include all images attached to to a page or\npost in addition to all documents.<\/p>\n\n<p><strong>Include\/Exclude Options<\/strong> <em>(New in Version 3.0)<\/em><\/p>\n\n<p>As the name suggests, these options allow for explicitly adding or removing\nmatched attachments in your gallery. Like with the IDs options above, these\noptions take a comma-delimited list of attachment IDs.<\/p>\n\n<p><strong>Limit Option<\/strong> <em>(New in Version 2.3)<\/em><\/p>\n\n<p>As the name suggests, this value will limit how many results are returned in the gallery.\nIf set to <em>-1<\/em>, the limit is infinite.<\/p>\n\n<p><strong>MIME Types Option<\/strong> <em>(New in Version 3.0)<\/em><\/p>\n\n<p>This is a comma-delimited list of all\n<a href=\"http:\/\/en.wikipedia.org\/wiki\/Internet_media_type#List_of_common_media_types\">MIME types<\/a>\nto be included in the gallery. Most users will not need to modify this value.<\/p>\n\n<p>One example use-case would be to include images in your gallery (which are\nnot included by default). To do this, you would simply set\n    mime_types=application,video,text,audio,image, where \"image\" is the only difference\nfrom the default value. You could also create a gallery which only includes PDFs\nby setting <code>mime_types=application\/pdf<\/code>.<\/p>\n\n<p><strong>New Window Option<\/strong> <em>(New in Version 3.2)<\/em><\/p>\n\n<p>If true, clicking one of the documents in your gallery will open the target link in a new window\/tab.<\/p>\n\n<p><strong>Order Option<\/strong><\/p>\n\n<p>This option works alongside the <code>orderby<\/code> option to determine whether the\ndocuments are displayed in ascending or descending order.<\/p>\n\n<p><strong>Orderby Option<\/strong><\/p>\n\n<ul>\n<li><code>menu_order<\/code> - This is probably the one you want to use. Menu order is\nthe order that icons appear when seen in the Insert \/ Upload Media Gallery\ndialog. To change this order, you simply drag the icons around until they\nare where you want them. In earlier versions of WordPress, menu_order was\nmodified by the integer fields in the Insert \/ Upload Media Gallery dialog.\nThese fields no longer exist in recent releases.<\/li>\n<li><code>title<\/code> - Order by title.<\/li>\n<li><code>date<\/code> - Order by upload date.<\/li>\n<li><code>modified<\/code> - Order by last modified date.<\/li>\n<li><code>rand<\/code> - Random order.<\/li>\n<li><code>ID<\/code> - Order by post id.<\/li>\n<li><code>author<\/code> - Order by author.<\/li>\n<li><code>name<\/code> - Order by attachment slug.<\/li>\n<li><code>parent<\/code> - Order by post\/page parent id.\n(Only useful in conjunction with <code>localpost=false<\/code> option.)<\/li>\n<li><code>comment_count<\/code> - Order by number of comments (available with WP &gt;= 2.9).<\/li>\n<li><code>none<\/code> - No order (available with Version 2.8).<\/li>\n<li><code>post__in<\/code> - Preserve post ID order given in the post__in array.<\/li>\n<\/ul>\n\n<p><strong>Relation Option<\/strong> <em>(New in Version 1.4)<\/em><\/p>\n\n<p>The relation option should only be used when also using the <em>category or custom\ntaxonomy<\/em> option (see above).<\/p>\n\n<p>When using multiple taxa this option allows you to decide whether the attachments\nreturned must match all of the different taxa specified (AND) or a minimum of one\ntaxa match (OR).<\/p>\n\n<p><em>NOTE: This has no bearing on the relationship between different terms for a single\ntaxon (eg: <code>[dg category=x,y,z relation=AND]<\/code> will return any attachments where the\ncategory is x, y, OR z). If you wish to return only attachments with all 3 categories,\nyou will instead need to use the following syntax: <code>[dg category=x,y,z category_relation=AND]<\/code>.\nThis syntax of *taxon<\/em>_relation will work for any taxon, not just \"category.\"*<\/p>\n\n<h4>Customize Appearance<\/h4>\n\n<p>The Default Document gallery will often fit quite well with whatever theme you\nare using. But, if you want to change things, Document Gallery makes that easy.\nJust navigate to <code>Settings -&gt; Document Gallery<\/code> and put any custom CSS in the\nprovided text box.<\/p>\n\n<p>See <a href=\"http:\/\/plugins.svn.wordpress.org\/document-gallery\/trunk\/assets\/css\/style.css\"><code>style.css<\/code><\/a>\nfor all of the ids and classes being used in a Document Gallery.<\/p>\n\n<p><strong>Example<\/strong><\/p>\n\n<p>Say I would like to include a border for the right and bottom of the document\nicon, but only when descriptions are shown (to delineate the icon from the\ndescription text). To do this, I would need to use the following CSS:<\/p>\n\n<pre><code>.document-icon-wrapper.descriptions .document-icon{\n   border-right: 1px solid #37824A;\n   border-bottom: 1px solid #37824A;\n}\n<\/code><\/pre>\n\n<p>Now, if I wanted to modify that code to instead add the same border to all of\nthe document-icons, regardless of whether they have a description or not, I\nwould just change the first line, removing the descriptions class like so:<\/p>\n\n<pre><code>.document-icon-wrapper .document-icon\n<\/code><\/pre>\n\n<h4>Developers<\/h4>\n\n<p>For those unfamiliar with content filters, <a href=\"http:\/\/codex.wordpress.org\/Plugin_API\/Filter_Reference\">here is some\ndocumentation<\/a> that you\nshould read before continuing.<\/p>\n\n<p><strong>Filter HTML Output<\/strong><\/p>\n\n<p>In Documnet Gallery version 2.2, we've released a more powerful HTML\ntemplating framework, making all generated output filterable, and thus\nconfigurable, by developers wishing to control the gallery output. Three\ndifferent filters are provided in order to access the various segments\nof a gallery: <code>dg_gallery_template<\/code>, <code>dg_row_template<\/code>, and <code>dg_icon_template<\/code>.\nThese filtered templates are used when dynamically generating output for each\ngallery.<\/p>\n\n<p>Each of the following filters provides an bool argument which indicates\nwhither the gallery being generated will display descriptions, which\nallows you to handle galleries with and without descriptions differently.<\/p>\n\n<p>If you wish to wrap your galleries in some additional content,\nthe <code>dg_gallery_template<\/code> is the tool for the job. With it you can include\ncontent prior to or following your document galleries. The filter\nexposes 2 special tags which are replaced during gallery generation\nwith data specific to that gallery. The tag is described below:<\/p>\n\n<ul>\n<li><strong>%id%<\/strong>: The id attribute value for this gallery.<\/li>\n<li><strong>%class%<\/strong>: The class attribute value for this gallery.<\/li>\n<li><strong>%data%<\/strong>: The one ore more data-* attributes for the gallery, which are necessary for client-side operations.<\/li>\n<li><strong>%rows%<\/strong>: This tag is replaced by all of the document gallery rows.\nEverything before this string will be rendered before the gallery and\neverything after this string will be rendered following the gallery.<\/li>\n<\/ul>\n\n<p>If you wish to modify how gallery rows are generated, <code>dg_row_template<\/code>,\nis provided for this purpose. This filter gives you control at the row\nlevel for how a gallery will be generated. The filter exposes 2 special tags\nwhich are replaced during gallery generation with row-specific data.\nThese tags are as follows:<\/p>\n\n<ul>\n<li><strong>%class%<\/strong>: The class attribute value for this row.<\/li>\n<li><strong>%icons%<\/strong>: The icon data for this row.<\/li>\n<\/ul>\n\n<p>If you wish to modify the HTML that wraps individual icons,\nthe <code>dg_icon_template<\/code> filter is what you will use. The filter is passed\ntwo arguments which may be used to gain additional information about\nthe document that will be used in generating this icon. The first\nargument is a bool value which indicates whether descriptions will\nbe used along with the icon and the second value is an integer WordPress\nattachment ID which may be used to lookup any relevant information\nyou need specific to that document. The filter exposes 5 special tags\nwhich are replaced during gallery generation with document-specific data.\nThese tags are as follows:<\/p>\n\n<ul>\n<li><strong>%date%<\/strong>: The date that the attachment was added to WordPress.<\/li>\n<li><strong>%description%<\/strong>: The attachment description (only present when rendering descriptions).<\/li>\n<li><strong>%extension%<\/strong>: The document file extension.<\/li>\n<li><strong>%img%<\/strong>: The URL pointing the the image that will be displayed.<\/li>\n<li><strong>%link%<\/strong>: The URL that will be loaded when the user clicks the icon.<\/li>\n<li><strong>%path%<\/strong>: The system path pointing to the document.<\/li>\n<li><strong>%size%<\/strong>: The human-readable file size formatted by\n<a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/size_format\">size_format<\/a>.<\/li>\n<li><strong>%target%<\/strong>: The target attribute for the anchor tag (e.g.: _blank, _self).<\/li>\n<li><strong>%time%<\/strong>: The time that the attachment was added to WordPress.<\/li>\n<li><strong>%title%<\/strong>: The human-readable title of the attachment.<\/li>\n<li><strong>%title_attribute%<\/strong>: The escaped title (above), safe for using HTML tag attributes.<\/li>\n<\/ul>\n\n<p>Below is an example that uses all three above filter methods to convert the output from a div-based\nlayout to a table-based layout with no icons, displaying the date of upload in the left column and\nthe title as a hyperlink to the attachment in the right column.<\/p>\n\n<pre><code>function dg_gallery_template($gallery, $use_descriptions) {\n     if ( ! $use_descriptions ) {\n         $gallery = '&lt;table id=\"%id%\" class=\"%class%\" %data%&gt;%rows%&lt;\/table&gt;';\n     }\n     return $gallery;\n }\n add_filter( 'dg_gallery_template', 'dg_gallery_template', 10, 2 );\n\n function dg_row_template($row, $use_descriptions) {\n     if ( ! $use_descriptions ) {\n         $row = '&lt;tr class=\"%class%\"&gt;%icons%&lt;\/tr&gt;';\n     }\n     return $row;\n }\n add_filter( 'dg_row_template', 'dg_row_template', 10, 2 );\n\n function dg_icon_template($icon, $use_descriptions, $id) {\n     if ( ! $use_descriptions ) {\n         $icon = '&lt;td&gt;%date%&lt;\/td&gt;&lt;td&gt;&lt;a href=\"%link%\" target=\"%target%\"&gt;&lt;span class=\"title\"&gt;%title%&lt;\/title&gt;&lt;\/td&gt;';\n     }\n     return $icon;\n }\n add_filter( 'dg_icon_template', 'dg_icon_template', 10, 3 );\n<\/code><\/pre>\n\n<p><strong>Filter Thumbnail Generation Methods<\/strong><\/p>\n\n<p>Document Gallery provides the <code>dg_thumbers<\/code> filter, which allows developers to\nadd, remove, or even re-order which methods are used to generate a thumbnail\nfor a given attachment.<\/p>\n\n<p>The value being filtered is an array of <code>DG_AbstractThumber<\/code> objects. You will want to look at this abstract class,\nlocated in the DG source under <code>inc\/thumbers<\/code> to see how to correctly implement the abstract methods. You'll notice\nthat <code>DG_AbstractThumber::init()<\/code> will handle creating a singleton instance of your class (though you can opt not\nto use this logic if you prefer). To register your implementation of <code>DG_AbstractThumber<\/code> using <code>init()<\/code>, you would\nsimply call YourThumberClass::init() and all of the work setting up the <code>dg_thumbers<\/code> filter to include your thumber\nwill be done for you.<\/p>\n\n<p>The following is an example taken from the Document Gallery source (with a few\nmodifications for ease of readability), where we add thumbnail generation for\nall Audio\/Video filetypes supported by WordPress:<\/p>\n\n<pre><code>class ImageThumber extends DG_AbstractThumber {\n\n    \/**\n     * @return string[] The extensions supported by this thumber.\n     *\/\n    protected function getThumberExtensions() {\n        return array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );\n    }\n\n    \/**\n     * @param string $ID The attachment ID to retrieve thumbnail from.\n     * @param int $pg Unused.\n     *\n     * @return bool|string  False on failure, URL to thumb on success.\n     *\/\n    public function getThumbnail( $ID, $pg = 1 ) {\n        $options = DG_Thumber::getOptions();\n        $ret     = false;\n\n        if ( $icon = image_downsize( $ID, array( $options['width'], $options['height'] ) ) ) {\n            $ret = $icon[0];\n        }\n\n        return $ret;\n    }\n\n    \/**\n     * @return int An integer from 0 to 100. Higher priorities will be attempted before lower priority thumbers.\n     *\/\n    public function getPriority() {\n        return 100;\n    }\n }\n\n \/\/ tells DG_AbstractThumber to create an instance of the class and apply to dg_thumbers filter\n ImageThumber::init();\n<\/code><\/pre>\n\n<p><strong>Filter Inclusion of Default Document Gallery CSS<\/strong><\/p>\n\n<p>If you wish to completely replace Document Gallery styling with your own CSS, you can prevent any any\nCSS being loaded by returning false in <code>dg_use_default_gallery_style<\/code> filter, like so:\n    add_filter('dg_use_default_gallery_style', '__return_false');<\/p>\n\n<p><em>NOTE: By design, this will <strong>NOT<\/strong> disable inclusion of any custom CSS set at\n    Dashboard -&gt; Settings -&gt; Document Gallery<\/em><\/p>\n\n<p><strong>Modify Gallery Query<\/strong><\/p>\n\n<p>If you wish to modify the query used by Document Gallery to retrieve attachments to be included in a gallery then\nthe <code>dg_query<\/code> action allows you to do exactly that. The signature for the action\nis <code>function dg_query(&amp;$query, $taxa, &amp;$excluded_keys, &amp;$errs)<\/code>. Each parameter is described below:<\/p>\n\n<ul>\n<li><strong>&amp;$query<\/strong>: This is the query to be modified as documented in <a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/WP_Query\">WordPress Codex<\/a>.<\/li>\n<li><strong>$taxa<\/strong>: The list of key\/value pairs for arguments passed into <code>[dg]<\/code> that do not match known keys.<\/li>\n<li><strong>&amp;$excluded_keys<\/strong>: The list of keys to not be processed by DG. If your extension uses a key and is not intended for\nDG to process, then the key should be added to this list.<\/li>\n<li><strong>&amp;$errs<\/strong>: The list of errors. If something goes wrong, this list should be appended with a description of what happened.<\/li>\n<\/ul>\n\n<!--section=faq-->\n<dl>\n<dt id='q%3A%20how%20do%20i%20use%20the%20document%20gallery%20block%20in%20the%20editor%3F'><h3>Q: How do I use the Document Gallery block in the editor?<\/h3><\/dt>\n<dd><p>A: In the WordPress Block Editor, click the '+' button to add a new block and search\nfor \"Document Gallery\". Once inserted, you'll see a preview of your gallery. Click on\nthe block to access the settings panel on the right side, where you can configure:<\/p>\n\n<ul>\n<li><strong>Limit to Current Post<\/strong> - Toggle to show only attachments from this post or all attachments<\/li>\n<li><strong>Columns, Order, Descriptions<\/strong> - Control gallery layout and appearance<\/li>\n<li><strong>Document Selection<\/strong> - Optionally click \"Select specific documents\" to manually select specific files<\/li>\n<\/ul>\n\n<p>The gallery updates in real-time as you adjust settings. No document selection is required\nif you want to show all attachments matching your criteria.<\/p><\/dd>\n<dt id='q%3A%20i%27m%20using%20taxonomies%2C%20but%20nothing%20is%20showing%20up%20in%20my%20gallery'><h3>Q: I'm using taxonomies, but nothing is showing up in my gallery<\/h3><\/dt>\n<dd><p>A: Remember that Document Gallery defaults to retrieving just attachments for the current post\/page.\nIf you want a broader scope of attachments, you'll also need tell Document Gallery to search everywhere\nlike so: <code>[dg id=-1 category=\"My Awesome Category\"]<\/code>.<\/p><\/dd>\n<dt id='q%3A%20ghostscript%20is%20installed%20on%20my%20server%2C%20but%20it%27s%20not%20working%21'><h3>Q: Ghostscript is installed on my server, but it's not working!<\/h3><\/dt>\n<dd><p>A: Document Gallery does a pretty good job of detecting where Ghostscript is installed,\nbut on some installs it may need a little help. To check whether this is the case,\nnavigate to <code>Dashboard -&gt; Settings -&gt; Document Gallery<\/code> and see if there is a notice\nnext to the Ghostscript checkbox indicating that your server is not properly configured.\nIf that notice does exist, the next step is to go to the <code>Advanced<\/code> tab on that same page\nand see if the Ghostscript path is set. If it is not, you'll need to manually fill it\nwith the location for your Ghostscript install (eg: <code>\/usr\/local\/bin\/gs<\/code>). Once that\nchange is saved, the Ghostscript checkbox should be enabled on the first tab.<\/p><\/dd>\n<dt id='q%3A%20why%20are%20all%20of%20my%20document%20icons%20in%20a%20single%20column%3F'><h3>Q: Why are all of my document icons in a single column?<\/h3><\/dt>\n<dd><p>A: Assuming that you do not have the <code>columns<\/code> attribute set to 1, the likely cause\nof this behavior is that descriptions are enabled. To fix this, simply add <code>descriptions=false<\/code>\n(eg: <code>[dg descriptions=false]<\/code>).<\/p><\/dd>\n<dt id='q%3A%20why%20is%20%5Binsert%20thumbnail%20generation%20method%5D%20enabled%20on%20one%20of%20my%20wordpress%20installs%2C%20but%20not%20on%20another%20one%3F'><h3>Q: Why is [insert thumbnail generation method] enabled on one of my WordPress installs, but not on another one?<\/h3><\/dt>\n<dd><p>A: Document Gallery works very hard behind the scenes to ensure that it enables\nas much as is possible for any given server, but some servers just can't do\nsome of the things that the plugin supports. Document Gallery detects when a\nserver can't do something (run Ghostscript, for example) and disables that option.\nIf you later modify your server to handle one of the thumbnail generation methods,\nDocument Gallery will notice this and re-enable the option on the settings page,\nthough you will need to go in and tell Document Gallery that it should use this\nnewly-enabled method.<\/p><\/dd>\n<dt id='q%3A%20why%20is%20ghostscript%20so%20much%20faster%20than%20imagick%3F'><h3>Q: Why is Ghostscript so much faster than Imagick?<\/h3><\/dt>\n<dd><p>A: This comes down to how the two programs work. Imagick actually delegates\nhandling of PDFs to Ghostscript behind the scenes, but it doesn't do so\nintelligently. Before passing off the PDF, it first reads the entire contents\nof the PDF into memory. Since we only need a single page to generate the\nthumbnail, this is much more work than is needed. Ghostscript, on the other hand,\ncan handle reading only one page into memory, thus doing much less work before\nreturning our thumbnail.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>Features For The Future<\/h4>\n\n<p>To see a list of features planned for the future as well as to propose your own\nideas for future Document Gallery development, take a look at our\n<a href=\"https:\/\/github.com\/thenadz\/document-gallery\/issues\">issue tracker<\/a>.<\/p>\n\n<h4>5.1.0<\/h4>\n\n<ul>\n<li><strong>Feature:<\/strong> Restores support for the classic editor which was removed in 5.0.\nDon't worry - Block Editor support remains as well!<\/li>\n<\/ul>\n\n<h4>5.0.0<\/h4>\n\n<ul>\n<li><strong>Major Enhancement:<\/strong> Full WordPress Block Editor integration! Insert and configure\ndocument galleries directly in the editor with an intuitive visual interface.<\/li>\n<li><strong>Enhancement:<\/strong> All gallery settings now available in the block settings panel with\nreal-time preview updates.<\/li>\n<li><strong>Enhancement:<\/strong> Added support for modern image formats: WebP (WordPress 5.8+) and\nAVIF (WordPress 6.5+). Document Gallery now leverages WordPress core thumbnail\ngeneration for these formats.<\/li>\n<li><strong>Removed:<\/strong> TinyMCE\/classic editor integration has been removed in favor of modern\nblock editor. The <code>[dg]<\/code> shortcode remains fully supported.<\/li>\n<li><strong>Code Quality:<\/strong> Replaced deprecated WordPress functions (<code>get_option('blog_charset')<\/code>,\nimproper use of <code>addslashes()<\/code>) with modern equivalents.<\/li>\n<li><strong>Code Quality:<\/strong> Improved AJAX response handling using WordPress best practices\n(<code>wp_send_json()<\/code>, proper header checking).<\/li>\n<li><strong>Code Quality:<\/strong> Removed all dead code from legacy editor integrations.<\/li>\n<li><strong>Compatibility:<\/strong> Minimum WordPress version updated to 6.1 (Block API v2 requirement).<\/li>\n<li><strong>Compatibility:<\/strong> Minimum PHP version remains 5.6.<\/li>\n<li><strong>Tested Up To:<\/strong> Document Gallery has been tested in WordPress 6.9.<\/li>\n<\/ul>\n\n<h4>4.4.4<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> We're BACK! After 6+ years dormant, we're working to make Document Gallery fully\nfunctional with current WordPress versions. This initial minor release addresses major bugs.\nFuture more major revisions forthcoming, which will provide deeper integration with the current\nWordPress editor.<\/li>\n<\/ul>\n\n<h4>4.4.3<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> The pagination logic was not working correctly, resulting in the gallery not returning to the\ntop after changing to a new page in some situations.<\/li>\n<\/ul>\n\n<h4>4.4.2<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> When pagination is enabled for a gallery, navigating to another page will now scroll the page\nback to the top of the gallery.<\/li>\n<li><strong>Enhancement:<\/strong> Added support for <code>%author%<\/code> to <code>dg_icon template<\/code> filter.<\/li>\n<\/ul>\n\n<h4>4.4.1<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> Added support for <code>%date%<\/code> and <code>%time%<\/code> to  <code>dg_icon_template<\/code>.<\/li>\n<\/ul>\n\n<h4>4.4<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> Document Gallery updated to support integration with\n<a href=\"https:\/\/codecanyon.net\/item\/wordpress-real-media-library-media-categories-folders\/13155134\">WP Real Media Library<\/a>.\nSimply install the <a href=\"https:\/\/wordpress.org\/plugins\/dg-real-media-library\/\">RML\/DG helper plugin<\/a> to use your RML\nfolders right from Document Gallery!<\/li>\n<\/ul>\n\n<h4>4.3.2<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Bug in editing gallery from post editor has been resolved.<\/li>\n<li><strong>Note:<\/strong> Minimum WordPress version has been bumped from 4.1 to 4.2.<\/li>\n<\/ul>\n\n<h4>4.3.1<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> WordPress 4.7 includes native support for PDF thumbnails. Document Gallery was already using some\nof this, but this update ensures that DG takes full advantage of the new core functionality, including some new\nlogic to allow older WordPress installs running Document Gallery to take advantage of some of the new goodies.<\/li>\n<li><strong>Tested Up To:<\/strong> Document Gallery has been tested in WP 4.7. Big thanks to\n<a href=\"https:\/\/wordpress.org\/support\/users\/oldrup\/\">Bjarne<\/a> for help with testing.<\/li>\n<li><strong>Reminder:<\/strong> Don't forget that <a href=\"https:\/\/thumber.co\">Thumber.co<\/a> can integrate with Document Gallery to greatly\nexpand supported file types (eg: Word, PowerPoint, Publisher, and Photoshop). Thumber.co offers a free 1-week trial\nif you want to try it before you buy it!<\/li>\n<\/ul>\n\n<h4>4.2.6<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Document Gallery was impossible to uninstall on some WordPress systems. This is addressed now.<\/li>\n<\/ul>\n\n<h4>4.2.5<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Resolves issue where visual editor gallery preview got stuck loading.<\/li>\n<\/ul>\n\n<h4>4.2.4<\/h4>\n\n<ul>\n<li><strong>Tested Up To:<\/strong> Document Gallery has been tested in WP 4.6.<\/li>\n<li><strong>Bug Fix:<\/strong> Resolves bug in visual editor that would result in the gallery preview never loading in some circumstances.<\/li>\n<\/ul>\n\n<h4>4.2.3<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Ghostscript thumbnail generation where the attachment name includes non-ASCII characters was failing\non some server configurations. Kevin Hock identified the bug AND provided the fix. Gold star!<\/li>\n<\/ul>\n\n<h4>4.2.2<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Ghostscript-based thumbnail generation was failing in a rare corner case. Thanks\n<a href=\"https:\/\/wordpress.org\/support\/profile\/sigvevidnes\">sigvevidnes<\/a> for identifying this issue!<\/li>\n<\/ul>\n\n<h4>4.2.1<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> There was a bug in validating user secrets for <a href=\"https:\/\/thumber.co\">Thumber.co<\/a> that has now been addressed.<\/li>\n<\/ul>\n\n<h4>4.2<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> Adding support for <code>tax_name<\/code>_include_children attribute, as requested by\n<a href=\"https:\/\/wordpress.org\/support\/topic\/add-shortcode-attribute-for-include_children\">John<\/a>. Thanks for the suggestion!<\/li>\n<li><strong>Enhancement:<\/strong> <a href=\"https:\/\/thumber.co\">Thumber.co<\/a> authentication secret is no longer output in the options\ndump on the admin settings tab, removing the possibility of this information being inadvertently printed in the\nsupport forum.<\/li>\n<\/ul>\n\n<h4>4.1.14<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> The handling of saving <a href=\"https:\/\/thumber.co\">Thumber.co<\/a> subscriptions was broken for some use cases.\nThe logic has been updated to work correctly in all cases.<\/li>\n<\/ul>\n\n<h4>4.1.13<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> HostGator users were noticing an issue where HTTP connection failures would show up while Document\nGallery was enabled. This resulted in symptoms like not being able to update plugins. This release modifies behavior\nto try and bypass this HostGator shortcoming. Work is still being done working with HostGator to try and identify\na more complete resolution.<\/li>\n<\/ul>\n\n<h4>4.1.12<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Resolves issues where the visual editor gallery preview was missing for a small subset of shortcode types.<\/li>\n<\/ul>\n\n<h4>4.1.11<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Resolves bug that resulted in various issues, including Jetpack and some core WordPress functionality\nnot working correctly.<\/li>\n<\/ul>\n\n<h4>4.1.10<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Resolves drag\/drop issues in the meida manager.<\/li>\n<\/ul>\n\n<h4>4.1.9<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Addresses issues with the IMagick thumbnail generation.<\/li>\n<li><strong>Enhancement:<\/strong> Handling thumbnail generation for image attachments better (should be faster &amp; more reliable).<\/li>\n<\/ul>\n\n<h4>4.1.8<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> There was a minor bug in how thumbnails for image attachments were being generated. It has been addressed.<\/li>\n<\/ul>\n\n<h4>4.1.7<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> There was a minor issue on some admin pages that has been resolved.<\/li>\n<\/ul>\n\n<h4>4.1.6<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> Added warning to plugins page when a PHP version &lt; 5.3 is being used.<\/li>\n<li><strong>Bug Fix:<\/strong> Resolves a \"class not found\" error.<\/li>\n<\/ul>\n\n<h4>4.1.5<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> For a subset of the users upgrading from <code>4.0<\/code> to <code>4.1.x<\/code>, the thumbnail images will have been corrupted\nduring the upgrade process. This release addresses the problem.<\/li>\n<\/ul>\n\n<h4>4.1.1 &amp; 4.1.2 &amp; 4.1.3 &amp; 4.1.4<\/h4>\n\n<ul>\n<li><strong>Bug Fix:<\/strong> Resolves various errors reported following <code>4.1<\/code> release.<\/li>\n<\/ul>\n\n<h4>4.1<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> At long last, support for Microsoft Office files (Word, PowerPoint, Publisher, Visio), as well as a\nboat-load of <a href=\"https:\/\/www.thumber.co\/about#filetypes\">other formats<\/a>, has been re-added to Document Gallery by way of\nintegration with the <a href=\"https:\/\/www.thumber.co\">Thumber.co<\/a> service. For a small fee you can generate images for all of your\nattachments using a service designed specifically to work well with Document Gallery. <strong>For a limited time,\nThumber.co is offering a free 7-day trial of the basic subscription. If you don't like it, all you have to do is\ncancel and you won't pay a penny.<\/strong><\/li>\n<li><strong>Enhancement:<\/strong> The pagination footer now includes more than just \"prev\" and \"next\", allowing for quicker navigation\nof long multi-page galleries. Additionally, the pagination footer will no longer be included if pagination is enabled,\nbut there are less than a page-length's worth of attachments in the gallery.<\/li>\n<li><strong>Enhancement:<\/strong> Massive rewrite of some core logic that had become unmaintainable. This will mean nothing to most\nusers, with the noted exception that if you were using the <code>dg_thumbers<\/code> filter you'll need to change some things.\nIf this applies to you then you'll want to hold off on upgrading until you've had a chance to rework your usage of the\nfilter to map to the new expected values.<\/li>\n<\/ul>\n\n<h4>4.0<\/h4>\n\n<ul>\n<li><strong>Enhancement:<\/strong> The WordPress visual editor now displays a full gallery preview.<\/li>\n<li><strong>Enhancement:<\/strong> You can now paginate your galleries. This is especially useful in large multi-hundred item galleries.\nTo enable pagination in your galleries, simply use <code>limit=##<\/code>.<\/li>\n<li><strong>Enhancement:<\/strong> All CSS &amp; JavaScript is now served minified to ensure the fastest possible load time for your site.<\/li>\n<li><strong>Enhancement:<\/strong> When using taxonomies to generate your galleries (eg: media categories) you can now use term slug\ninstead of the name. <em>Thanks andremalenfant for suggesting this!<\/em><\/li>\n<li><strong>Enhancement:<\/strong> The structure of the gallery output has been cleaned up, making it easier to style if you chose to\nuse custom CSS. <em>NOTE: This modified structure may break existing custom CSS or PHP filtering, so be sure to check\nthis if you're using either of those features.<\/em><\/li>\n<li><strong>Bug Fix:<\/strong> The storage of the DG thumbnail cache was very broken. Due to how the cache was originally designed, it\nran into issues at large scale and on busy sites, which resulted in difficult to track bugs. The entire storage\nmechanism for the cache has been rewritten from the ground up to address this issue, which will result in faster\ngallery generation and more reliable performance.<\/li>\n<li><strong>Bug Fix:<\/strong> In the thumbnail management tab of the DG settings, sorting by title was broken. This has been fixed.<\/li>\n<li><strong>Bug Fix:<\/strong> <code>Limit<\/code> was not working in cases where the <code>ids<\/code> or <code>include<\/code> attribute were present. This has been fixed.<\/li>\n<li><strong>Tested Up To:<\/strong> Document Gallery has been tested in WP 4.4 beta.<\/li>\n<\/ul>\n\n<p><strong>NOTE: All earlier changes may be found in the CHANGELOG.md file.<\/strong><\/p>","raw_excerpt":"This plugin generates thumbnails for documents and displays them in a gallery-like format for easy sharing.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/19647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=19647"}],"author":[{"embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/danrossiter"}],"wp:attachment":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=19647"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=19647"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=19647"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=19647"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=19647"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=19647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}