Title: Document Gallery
Author: Dan Rossiter
Published: <strong>August 25, 2012</strong>
Last modified: December 9, 2025

---

Search plugins

![](https://ps.w.org/document-gallery/assets/icon.svg?rev=983329)

# Document Gallery

 By [Dan Rossiter](https://profiles.wordpress.org/danrossiter/)

[Download](https://downloads.wordpress.org/plugin/document-gallery.5.1.0.zip)

 * [Details](https://wordpress.org/plugins/document-gallery/#description)
 * [Reviews](https://wordpress.org/plugins/document-gallery/#reviews)
 *  [Installation](https://wordpress.org/plugins/document-gallery/#installation)
 * [Development](https://wordpress.org/plugins/document-gallery/#developers)

 [Support](https://wordpress.org/support/plugin/document-gallery/)

## Description

Display your documents beautifully! Document Gallery creates thumbnail galleries
for PDFs, Word documents, PowerPoint presentations, and other file types—just like
WordPress does for images.

#### Key Features

 * **WordPress Block Editor** – Insert galleries with a single click, configure 
   visually
 * **Automatic Thumbnails** – Generates preview images for documents (PDF, Office
   files, etc.)
 * **Modern Image Formats** – Full support for WebP and AVIF images (WordPress 6.5
   +)
 * **Flexible Display** – Grid or list layout with optional descriptions
 * **Smart Filtering** – Show all attachments, current post only, or specific documents
 * **Pagination Support** – Handle large document libraries efficiently
 * **Fully Customizable** – Control columns, sorting, links, and styling
 * **Classic Shortcode** – `[dg]` shortcode available for template use

#### Perfect For

 * Document libraries and resource centers
 * Portfolio and work sample galleries
 * Publication and whitepaper collections
 * Course materials and downloads
 * Legal document repositories

#### Block Editor Integration

Click the ‘+’ button in the editor and search for “Document Gallery” to insert a
gallery block. All configuration options appear in the sidebar—no shortcode knowledge
required. Select specific documents or let the gallery auto-populate based on your
criteria.

#### Shortcode Support

The classic `[dg]` 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.

#### Developer Friendly

Document Gallery provides extensive filters and actions for customizing thumbnail
generation, HTML output, and gallery queries. See the Installation tab for complete
developer documentation.

#### Partners

 * **WP Real Media Library**: Document Gallery seamlessly integrates with RML by
   way of a
    [helper plugin](https://wordpress.org/plugins/dg-real-media-library/).

#### Translation

Document Gallery has to-date been translated into **6** languages, listed below.

 * **Finnish** — _Thanks, [villevetela](https://wordpress.org/support/profile/villevetela)!_
 * **French** — _Thanks, Marc Liotard and [Traffic Influence](http://www.trafic-influence.com/)!_
 * **Russian** — _Thanks, [demur](https://wordpress.org/support/profile/demur)!_
 * **Spanish** — _Thanks, Andrew Kurtis and [WebHostingHub](http://www.webhostinghub.com/)!_
 * **Swedish** — _Thanks, [mepmepmep](https://wordpress.org/support/profile/mepmepmep)!_
 * **Ukrainian** — _Thanks, [demur](https://wordpress.org/support/profile/demur)!_

#### Developers

Document Gallery includes features intended to make integration with other plugins

simple. See the bottom of the **Installation** tab for specific documentation on
the various features provided.

_If this plugin has helped you, please take a moment to [rate it](https://wordpress.org/support/view/plugin-reviews/document-gallery#postform)!_

## Screenshots

 * [[
 * All gallery options are accessible through the block settings sidebar, with real-
   time preview updates as you make changes.
 * [[
 * Document Gallery integrates seamlessly with the WordPress Block Editor, providing
   an intuitive interface for creating and configuring galleries.
 * [[
 * This is an example of “fancy” thumbnails. The images are a copy of the front 
   page for each document.
 * [[
 * This is an example of multiple Document Galleries on a single page (using the`
   ids` attribute). It also shows how images will appear in a Document Gallery. 
   Note that the description field supports HTML markup, so the possibilities are
   endless!
 * [[
 * This is how the Document Gallery looks with `descriptions=false` (default). Note
   that the display inherits styling from your active theme.

## Blocks

This plugin provides 1 block.

 *   Document Gallery Block to display a document gallery.

## Installation

#### Automatic Installation

 1. Go to Plugins > Add New in your WordPress admin
 2. Search for “Document Gallery”
 3. Click Install Now, then Activate

#### Getting Started

**Block Editor (Recommended)**

 1. Create or edit a post/page
 2. Click the ‘+’ button and search for “Document Gallery”
 3. Insert the block and configure options in the sidebar
 4. Optionally select specific documents, or let it auto-populate

**Shortcode Method**

Add `[dg]` to any post, page, or text widget. See Document Gallery Options below
for configuration.

#### Manual Installation

 1. Download the plugin from WordPress.org
 2. Upload the `document-gallery` folder to `/wp-content/plugins/`
 3. Activate through the Plugins menu

#### Document Gallery Options

In order to include all compatible documents from a given page or post, you
 must
include the following shortcode in the post: `[dg]`.

In addition to the default behavior, the plugin provides many options to
 customize
behavior with various attributes, some of which are shown below:

    ```
    [dg [fancy=<true/false>] [attachment_pg=<true/false>] [descriptions=<true/false>] [order=<ASC/DESC>] [orderby=<**see below**>]]
    ```

Though the shortcode above may seem far from “short,” none of the attributes are

required and most users will find that the plugin meets your needs “out of the box”
without any added attributes.

**Default Values**

Default document gallery behavior can be configured in your dashboard under `Settings-
> Document Gallery`.

**Attachment Page Option** _(New in Version 1.1)_

This option determines whether each document icon will link to the actual file
 
or to its attachment page. If you want the user to be able to click on the icon 
and directly receive the option to download then use `attachment_pg=false` (the 
default). If you have information on the attachment page that you want the link 
to go to, use `attachment_pg=true`.

**Categories/Custom Taxonomy Option** _(New in Version 1.4)_

With the `categories` option you are able to select attachments based on
 their 
assigned category or any other [custom taxon](https://codex.wordpress.org/Taxonomies).
Categories or any custom taxon can be referenced simply by including `category=category_value`
or `taxon_name=taxon_value`. Multiple values for a single taxon may be separated
by commas. Note that if a taxon value contains spaces then the entire comma- delimited
list must be quoted.

**Columns Option** _(New in Version 3.0)_

The columns option does what it sounds like — sets how many columns to use in
 rendering
your gallery. With `columns=-1`, you will get an infinite number of columns. In 
other words, only 1 row with all icons.

**Descriptions Option**

If `true`, each document will take its own line with the description displayed
 
alongside it.

_Note: this will use the `description` field, **not** the `caption`. Be
 careful
when entering your document data.

**Fancy Option** _(New in Version 2.0)_

If `true`, we will try to generate a thumbnail for each document in the gallery.

The success in generating thumbs will depend mostly on what your server supports.
To fine-tune how thumbnails are generated, visit `Settings -> Document Gallery` 
in your site’s dashboard.

**ID Option** _(New in Version 3.0)_

This option indicates from which parent post/page to retrieve attachments.
 If not
explicitly set, the default will be the post/page where the shortcode is being used.

If you do not wish to filter by parent, `id=-1` will match all attachments.

**IDs Option** _(New in Version 1.2)_

This is an advanced option intended for experienced WordPress users. If this
 option
is used, the plugin will ignore attached documents, instead including all attachments
defined by the `ids` attribute (e.g.: `ids=10,2,4,42`).

_Note: If this attribute is used, order defaults to the order of IDs given
 rather
than menu\_order unless order is explicitly stated.

**Images Option** _(New in Version 1.2)_

This option will tell the plugin to include all images attached to to a page or

post in addition to all documents.

**Include/Exclude Options** _(New in Version 3.0)_

As the name suggests, these options allow for explicitly adding or removing
 matched
attachments in your gallery. Like with the IDs options above, these options take
a comma-delimited list of attachment IDs.

**Limit Option** _(New in Version 2.3)_

As the name suggests, this value will limit how many results are returned in the
gallery.
 If set to _-1_, the limit is infinite.

**MIME Types Option** _(New in Version 3.0)_

This is a comma-delimited list of all
 [MIME types](http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types)
to be included in the gallery. Most users will not need to modify this value.

One example use-case would be to include images in your gallery (which are
 not 
included by default). To do this, you would simply set mime_types=application,video,
text,audio,image, where “image” is the only difference from the default value. You
could also create a gallery which only includes PDFs by setting `mime_types=application/
pdf`.

**New Window Option** _(New in Version 3.2)_

If true, clicking one of the documents in your gallery will open the target link
in a new window/tab.

**Order Option**

This option works alongside the `orderby` option to determine whether the
 documents
are displayed in ascending or descending order.

**Orderby Option**

 * `menu_order` – This is probably the one you want to use. Menu order is
    the order
   that icons appear when seen in the Insert / Upload Media Gallery dialog. To change
   this order, you simply drag the icons around until they are where you want them.
   In earlier versions of WordPress, menu_order was modified by the integer fields
   in the Insert / Upload Media Gallery dialog. These fields no longer exist in 
   recent releases.
 * `title` – Order by title.
 * `date` – Order by upload date.
 * `modified` – Order by last modified date.
 * `rand` – Random order.
 * `ID` – Order by post id.
 * `author` – Order by author.
 * `name` – Order by attachment slug.
 * `parent` – Order by post/page parent id.
    (Only useful in conjunction with `localpost
   =false` option.)
 * `comment_count` – Order by number of comments (available with WP >= 2.9).
 * `none` – No order (available with Version 2.8).
 * `post__in` – Preserve post ID order given in the post__in array.

**Relation Option** _(New in Version 1.4)_

The relation option should only be used when also using the _category or custom

taxonomy
 option (see above).

When using multiple taxa this option allows you to decide whether the attachments

returned must match all of the different taxa specified (AND) or a minimum of one
taxa match (OR).

_NOTE: This has no bearing on the relationship between different terms for a single

taxon (eg: `[dg category=x,y,z relation=AND]` will return any attachments where 
the category is x, y, OR z). If you wish to return only attachments with all 3 categories,
you will instead need to use the following syntax: `[dg category=x,y,z category\
_relation=AND]`. This syntax of *taxon_relation will work for any taxon, not just“
category.”*

#### Customize Appearance

The Default Document gallery will often fit quite well with whatever theme you
 
are using. But, if you want to change things, Document Gallery makes that easy. 
Just navigate to `Settings -> Document Gallery` and put any custom CSS in the provided
text box.

See [`style.css`](https://plugins.svn.wordpress.org/document-gallery/trunk/assets/css/style.css)

for all of the ids and classes being used in a Document Gallery.

**Example**

Say I would like to include a border for the right and bottom of the document
 icon,
but only when descriptions are shown (to delineate the icon from the description
text). To do this, I would need to use the following CSS:

    ```
    .document-icon-wrapper.descriptions .document-icon{
       border-right: 1px solid #37824A;
       border-bottom: 1px solid #37824A;
    }
    ```

Now, if I wanted to modify that code to instead add the same border to all of
 the
document-icons, regardless of whether they have a description or not, I would just
change the first line, removing the descriptions class like so:

    ```
    .document-icon-wrapper .document-icon
    ```

#### Developers

For those unfamiliar with content filters, [here is some
 documentation
 that you

should read before continuing.

**Filter HTML Output**

In Documnet Gallery version 2.2, we’ve released a more powerful HTML
 templating
framework, making all generated output filterable, and thus configurable, by developers
wishing to control the gallery output. Three different filters are provided in order
to access the various segments of a gallery: `dg_gallery_template`, `dg_row_template`,
and `dg_icon_template`. These filtered templates are used when dynamically generating
output for each gallery.

Each of the following filters provides an bool argument which indicates
 whither
the gallery being generated will display descriptions, which allows you to handle
galleries with and without descriptions differently.

If you wish to wrap your galleries in some additional content,
 the `dg_gallery_template`
is the tool for the job. With it you can include content prior to or following your
document galleries. The filter exposes 2 special tags which are replaced during 
gallery generation with data specific to that gallery. The tag is described below:

 * **%id%**: The id attribute value for this gallery.
 * **%class%**: The class attribute value for this gallery.
 * **%data%**: The one ore more data-* attributes for the gallery, which are necessary
   for client-side operations.
 * **%rows%**: This tag is replaced by all of the document gallery rows.
    Everything
   before this string will be rendered before the gallery and everything after this
   string will be rendered following the gallery.

If you wish to modify how gallery rows are generated, `dg_row_template`,
 is provided
for this purpose. This filter gives you control at the row level for how a gallery
will be generated. The filter exposes 2 special tags which are replaced during gallery
generation with row-specific data. These tags are as follows:

 * **%class%**: The class attribute value for this row.
 * **%icons%**: The icon data for this row.

If you wish to modify the HTML that wraps individual icons,
 the `dg_icon_template`
filter is what you will use. The filter is passed two arguments which may be used
to gain additional information about the document that will be used in generating
this icon. The first argument is a bool value which indicates whether descriptions
will be used along with the icon and the second value is an integer WordPress attachment
ID which may be used to lookup any relevant information you need specific to that
document. The filter exposes 5 special tags which are replaced during gallery generation
with document-specific data. These tags are as follows:

 * **%date%**: The date that the attachment was added to WordPress.
 * **%description%**: The attachment description (only present when rendering descriptions).
 * **%extension%**: The document file extension.
 * **%img%**: The URL pointing the the image that will be displayed.
 * **%link%**: The URL that will be loaded when the user clicks the icon.
 * **%path%**: The system path pointing to the document.
 * **%size%**: The human-readable file size formatted by
    [size_format](https://codex.wordpress.org/Function_Reference/size_format).
 * **%target%**: The target attribute for the anchor tag (e.g.: _blank, _self).
 * **%time%**: The time that the attachment was added to WordPress.
 * **%title%**: The human-readable title of the attachment.
 * **%title_attribute%**: The escaped title (above), safe for using HTML tag attributes.

Below is an example that uses all three above filter methods to convert the output
from a div-based
 layout to a table-based layout with no icons, displaying the date
of upload in the left column and the title as a hyperlink to the attachment in the
right column.

    ```
    function dg_gallery_template($gallery, $use_descriptions) {
         if ( ! $use_descriptions ) {
             $gallery = '<table id="%id%" class="%class%" %data%>%rows%</table>';
         }
         return $gallery;
     }
     add_filter( 'dg_gallery_template', 'dg_gallery_template', 10, 2 );

     function dg_row_template($row, $use_descriptions) {
         if ( ! $use_descriptions ) {
             $row = '<tr class="%class%">%icons%</tr>';
         }
         return $row;
     }
     add_filter( 'dg_row_template', 'dg_row_template', 10, 2 );

     function dg_icon_template($icon, $use_descriptions, $id) {
         if ( ! $use_descriptions ) {
             $icon = '<td>%date%</td><td><a href="%link%" target="%target%"><span class="title">%title%</title></td>';
         }
         return $icon;
     }
     add_filter( 'dg_icon_template', 'dg_icon_template', 10, 3 );
    ```

**Filter Thumbnail Generation Methods**

Document Gallery provides the `dg_thumbers` filter, which allows developers to
 
add, remove, or even re-order which methods are used to generate a thumbnail for
a given attachment.

The value being filtered is an array of `DG_AbstractThumber` objects. You will want
to look at this abstract class,
 located in the DG source under `inc/thumbers` to
see how to correctly implement the abstract methods. You’ll notice that `DG_AbstractThumber::
init()` will handle creating a singleton instance of your class (though you can 
opt not to use this logic if you prefer). To register your implementation of `DG_AbstractThumber`
using `init()`, you would simply call YourThumberClass::init() and all of the work
setting up the `dg_thumbers` filter to include your thumber will be done for you.

The following is an example taken from the Document Gallery source (with a few
 
modifications for ease of readability), where we add thumbnail generation for all
Audio/Video filetypes supported by WordPress:

    ```
    class ImageThumber extends DG_AbstractThumber {

        /**
         * @return string[] The extensions supported by this thumber.
         */
        protected function getThumberExtensions() {
            return array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
        }

        /**
         * @param string $ID The attachment ID to retrieve thumbnail from.
         * @param int $pg Unused.
         *
         * @return bool|string  False on failure, URL to thumb on success.
         */
        public function getThumbnail( $ID, $pg = 1 ) {
            $options = DG_Thumber::getOptions();
            $ret     = false;

            if ( $icon = image_downsize( $ID, array( $options['width'], $options['height'] ) ) ) {
                $ret = $icon[0];
            }

            return $ret;
        }

        /**
         * @return int An integer from 0 to 100. Higher priorities will be attempted before lower priority thumbers.
         */
        public function getPriority() {
            return 100;
        }
     }

     // tells DG_AbstractThumber to create an instance of the class and apply to dg_thumbers filter
     ImageThumber::init();
    ```

**Filter Inclusion of Default Document Gallery CSS**

If you wish to completely replace Document Gallery styling with your own CSS, you
can prevent any any
 CSS being loaded by returning false in `dg_use_default_gallery_style`
filter, like so: add_filter(‘dg_use_default_gallery_style’, ‘__return_false’);

_NOTE: By design, this will **NOT** disable inclusion of any custom CSS set at
 
Dashboard -> Settings -> Document Gallery

**Modify Gallery Query**

If you wish to modify the query used by Document Gallery to retrieve attachments
to be included in a gallery then
 the `dg_query` action allows you to do exactly
that. The signature for the action is `function dg_query(&$query, $taxa, &$excluded_keys,&
$errs)`. Each parameter is described below:

 * **&$query**: This is the query to be modified as documented in [WordPress Codex](https://codex.wordpress.org/Class_Reference/WP_Query).
 * **$taxa**: The list of key/value pairs for arguments passed into `[dg]` that 
   do not match known keys.
 * **&$excluded_keys**: The list of keys to not be processed by DG. If your extension
   uses a key and is not intended for
    DG to process, then the key should be added
   to this list.
 * **&$errs**: The list of errors. If something goes wrong, this list should be 
   appended with a description of what happened.

## FAQ

### Q: How do I use the Document Gallery block in the editor?

A: In the WordPress Block Editor, click the ‘+’ button to add a new block and search

for “Document Gallery”. Once inserted, you’ll see a preview of your gallery. Click
on the block to access the settings panel on the right side, where you can configure:

 * **Limit to Current Post** – Toggle to show only attachments from this post or
   all attachments
 * **Columns, Order, Descriptions** – Control gallery layout and appearance
 * **Document Selection** – Optionally click “Select specific documents” to manually
   select specific files

The gallery updates in real-time as you adjust settings. No document selection is
required
 if you want to show all attachments matching your criteria.

### Q: I’m using taxonomies, but nothing is showing up in my gallery

A: Remember that Document Gallery defaults to retrieving just attachments for the
current post/page.
 If you want a broader scope of attachments, you’ll also need
tell Document Gallery to search everywhere like so: `[dg id=-1 category="My Awesome
Category"]`.

### Q: Ghostscript is installed on my server, but it’s not working!

A: Document Gallery does a pretty good job of detecting where Ghostscript is installed,

but on some installs it may need a little help. To check whether this is the case,
navigate to `Dashboard -> Settings -> Document Gallery` and see if there is a notice
next to the Ghostscript checkbox indicating that your server is not properly configured.
If that notice does exist, the next step is to go to the `Advanced` tab on that 
same page and see if the Ghostscript path is set. If it is not, you’ll need to manually
fill it with the location for your Ghostscript install (eg: `/usr/local/bin/gs`).
Once that change is saved, the Ghostscript checkbox should be enabled on the first
tab.

### Q: Why are all of my document icons in a single column?

A: Assuming that you do not have the `columns` attribute set to 1, the likely cause

of this behavior is that descriptions are enabled. To fix this, simply add `descriptions
=false` (eg: `[dg descriptions=false]`).

### Q: Why is [insert thumbnail generation method] enabled on one of my WordPress installs, but not on another one?

A: Document Gallery works very hard behind the scenes to ensure that it enables

as much as is possible for any given server, but some servers just can’t do some
of the things that the plugin supports. Document Gallery detects when a server can’t
do something (run Ghostscript, for example) and disables that option. If you later
modify your server to handle one of the thumbnail generation methods, Document Gallery
will notice this and re-enable the option on the settings page, though you will 
need to go in and tell Document Gallery that it should use this newly-enabled method.

### Q: Why is Ghostscript so much faster than Imagick?

A: This comes down to how the two programs work. Imagick actually delegates
 handling
of PDFs to Ghostscript behind the scenes, but it doesn’t do so intelligently. Before
passing off the PDF, it first reads the entire contents of the PDF into memory. 
Since we only need a single page to generate the thumbnail, this is much more work
than is needed. Ghostscript, on the other hand, can handle reading only one page
into memory, thus doing much less work before returning our thumbnail.

## Reviews

![](https://secure.gravatar.com/avatar/dce4997cbd48a047b44eb8f2957c9b4db5515190724085a703ea964e055a3707?
s=60&d=retro&r=g)

### 󠀁[Plugin works really well even on WP 6.8.1](https://wordpress.org/support/topic/plugin-works-really-well-even-on-wp-6-8-1/)󠁿

 [ulyssesnz](https://profiles.wordpress.org/ulyssesnz/) July 11, 2025

Hi Dan, I have been using the Document Gallery plugin for many years and swear by
it. It has also been working really well on WP version 6.8.1 with PHP version 7.4.33
Unfortunately when my hosting provider updated to PHP ver 8.3.22, the plugin produced
a critical error on the website. Current setup WordPress version 6.8.1Active theme:
Total (version 2.1.93)Current plugin: Document Gallery (version 4.4.3) PHP version
8.3.22 Error Details An error of type E_ERROR was caused in line 6 of the file /
home/ibexind/public_html/wp-content/plugins/document-gallery/inc/class-gallery.php.
Error message: Uncaught Error: Class “DG_Gallery” not found in /home/ibexind/public_html/
wp-content/plugins/document-gallery/inc/class-gallery.php:6Stack trace: 0 /home/
ibexind/public_html/wp-content/plugins/document-gallery/admin/tabs/general-tab.php(
10): include_once() 1 /home/ibexind/public_html/wp-content/plugins/document-gallery/
admin/class-admin.php(202): dg_register_settings() 2 /home/ibexind/public_html/wp-
includes/class-wp-hook.php(324): DG_Admin::registerSettings() 3 /home/ibexind/public_html/
wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 4 /home/ibexind/public_html/
wp-includes/plugin.php(517): WP_Hook->do_action() 5 /home/ibexind/public_html/wp-
admin/admin.php(176): do_action() 6 /home/ibexind/public_html/wp-admin/options-general.
php(10): require_once(‘/home/ibexind/p…’) 7 {main} thrown I had to deactivate the
plugin to get the site operational. Can you advise which PHP version is the plugin
compatible with? Thanks

![](https://secure.gravatar.com/avatar/119d8a7a876d1290502d3896b175e71f28b5cd5a9b50fcc5418678ef1dae87f5?
s=60&d=retro&r=g)

### 󠀁[Works fine on WP 6.5.4](https://wordpress.org/support/topic/works-fine-on-wp-6-5-4/)󠁿

 [Marc Lafay](https://profiles.wordpress.org/marc-lafay/) June 14, 2024

Although some administration functions are missing, this plugin is operational on
recent versions of WP. I haven’t found the equivalent elsewhere, so it’s a shame
it’s not being maintained.

![](https://secure.gravatar.com/avatar/6cfca84250f270004523d23042e8119ae9f1e6cfe9bc226745de55e6a0596d5f?
s=60&d=retro&r=g)

### 󠀁[Not working](https://wordpress.org/support/topic/not-working-4195/)󠁿

 [squaladesign](https://profiles.wordpress.org/squaladesign/) January 25, 2024

After 1 hour, I give up. I couldn’t find a way to show the shortcode.

![](https://secure.gravatar.com/avatar/19ef37e66445e85b9d5860fccb73333449c4f29cc4217083d8e7599ad74eedba?
s=60&d=retro&r=g)

### 󠀁[Totally Busted](https://wordpress.org/support/topic/totally-busted/)󠁿

 [jporozynski](https://profiles.wordpress.org/jporozynski/) November 21, 2022

Doesn’t work anymore.

![](https://secure.gravatar.com/avatar/7704946694f465431f23c81e56a896cc142e015c7f52652529b55843a0ad4128?
s=60&d=retro&r=g)

### 󠀁[Offline](https://wordpress.org/support/topic/offline-12/)󠁿

 [AJ](https://profiles.wordpress.org/akwasiijunior/) April 5, 2022

This plugin should be taken offline since its not working with current WP versions

![](https://secure.gravatar.com/avatar/9a53327b6b64a131f2538172f1ecdc62873cbe948b3b963423c9bdf774dbffdd?
s=60&d=retro&r=g)

### 󠀁[Update please?](https://wordpress.org/support/topic/update-please-32/)󠁿

 [dabarrister](https://profiles.wordpress.org/dabarrister/) February 19, 2022

There are two current issues: 1) Prior to PHP 7.4 the code could include the parameters
in any order in the “Implode” argument. Now, the glue string has to be declared 
first and the array second (for this plugin, [implode( $ids, ‘, ‘ )] should say [
implode(‘, ‘,$ids,)]. 2) When clicking back into a tab previously clicked, the content
disappears. Reloading the page restores the content, but the same behavior exists(
disappears again when a tab is clicked back into). Otherwise, the plugin is handy
and works well.

 [ Read all 112 reviews ](https://wordpress.org/support/plugin/document-gallery/reviews/)

## Contributors & Developers

“Document Gallery” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Dan Rossiter ](https://profiles.wordpress.org/danrossiter/)
 *   [ demur ](https://profiles.wordpress.org/demur/)

“Document Gallery” has been translated into 3 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/document-gallery/contributors)
for their contributions.

[Translate “Document Gallery” into your language.](https://translate.wordpress.org/projects/wp-plugins/document-gallery)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/document-gallery/),
check out the [SVN repository](https://plugins.svn.wordpress.org/document-gallery/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/document-gallery/)
by [RSS](https://plugins.trac.wordpress.org/log/document-gallery/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### Features For The Future

To see a list of features planned for the future as well as to propose your own

ideas for future Document Gallery development, take a look at our [issue tracker](https://github.com/thenadz/document-gallery/issues).

#### 5.1.0

 * **Feature:** Restores support for the classic editor which was removed in 5.0.
   
   Don’t worry – Block Editor support remains as well!

#### 5.0.0

 * **Major Enhancement:** Full WordPress Block Editor integration! Insert and configure
   
   document galleries directly in the editor with an intuitive visual interface.
 * **Enhancement:** All gallery settings now available in the block settings panel
   with
    real-time preview updates.
 * **Enhancement:** Added support for modern image formats: WebP (WordPress 5.8+)
   and
    AVIF (WordPress 6.5+). Document Gallery now leverages WordPress core thumbnail
   generation for these formats.
 * **Removed:** TinyMCE/classic editor integration has been removed in favor of 
   modern
    block editor. The `[dg]` shortcode remains fully supported.
 * **Code Quality:** Replaced deprecated WordPress functions (`get_option('blog_charset')`,
   
   improper use of `addslashes()`) with modern equivalents.
 * **Code Quality:** Improved AJAX response handling using WordPress best practices
   (`
   wp_send_json()`, proper header checking).
 * **Code Quality:** Removed all dead code from legacy editor integrations.
 * **Compatibility:** Minimum WordPress version updated to 6.1 (Block API v2 requirement).
 * **Compatibility:** Minimum PHP version remains 5.6.
 * **Tested Up To:** Document Gallery has been tested in WordPress 6.9.

#### 4.4.4

 * **Bug Fix:** We’re BACK! After 6+ years dormant, we’re working to make Document
   Gallery fully
    functional with current WordPress versions. This initial minor
   release addresses major bugs. Future more major revisions forthcoming, which 
   will provide deeper integration with the current WordPress editor.

#### 4.4.3

 * **Bug Fix:** The pagination logic was not working correctly, resulting in the
   gallery not returning to the
    top after changing to a new page in some situations.

#### 4.4.2

 * **Enhancement:** When pagination is enabled for a gallery, navigating to another
   page will now scroll the page
    back to the top of the gallery.
 * **Enhancement:** Added support for `%author%` to `dg_icon template` filter.

#### 4.4.1

 * **Enhancement:** Added support for `%date%` and `%time%` to `dg_icon_template`.

#### 4.4

 * **Enhancement:** Document Gallery updated to support integration with
    [WP Real Media Library](https://codecanyon.net/item/wordpress-real-media-library-media-categories-folders/13155134).
   Simply install the [RML/DG helper plugin](https://wordpress.org/plugins/dg-real-media-library/)
   to use your RML folders right from Document Gallery!

#### 4.3.2

 * **Bug Fix:** Bug in editing gallery from post editor has been resolved.
 * **Note:** Minimum WordPress version has been bumped from 4.1 to 4.2.

#### 4.3.1

 * **Enhancement:** WordPress 4.7 includes native support for PDF thumbnails. Document
   Gallery was already using some
    of this, but this update ensures that DG takes
   full advantage of the new core functionality, including some new logic to allow
   older WordPress installs running Document Gallery to take advantage of some of
   the new goodies.
 * **Tested Up To:** Document Gallery has been tested in WP 4.7. Big thanks to
    
   [Bjarne](https://wordpress.org/support/users/oldrup/) for help with testing.
 * **Reminder:** Don’t forget that [Thumber.co](https://thumber.co) can integrate
   with Document Gallery to greatly
    expand supported file types (eg: Word, PowerPoint,
   Publisher, and Photoshop). Thumber.co offers a free 1-week trial if you want 
   to try it before you buy it!

#### 4.2.6

 * **Bug Fix:** Document Gallery was impossible to uninstall on some WordPress systems.
   This is addressed now.

#### 4.2.5

 * **Bug Fix:** Resolves issue where visual editor gallery preview got stuck loading.

#### 4.2.4

 * **Tested Up To:** Document Gallery has been tested in WP 4.6.
 * **Bug Fix:** Resolves bug in visual editor that would result in the gallery preview
   never loading in some circumstances.

#### 4.2.3

 * **Bug Fix:** Ghostscript thumbnail generation where the attachment name includes
   non-ASCII characters was failing
    on some server configurations. Kevin Hock identified
   the bug AND provided the fix. Gold star!

#### 4.2.2

 * **Bug Fix:** Ghostscript-based thumbnail generation was failing in a rare corner
   case. Thanks
    [sigvevidnes](https://wordpress.org/support/profile/sigvevidnes)
   for identifying this issue!

#### 4.2.1

 * **Bug Fix:** There was a bug in validating user secrets for [Thumber.co](https://thumber.co)
   that has now been addressed.

#### 4.2

 * **Enhancement:** Adding support for `tax_name`_include_children attribute, as
   requested by
    [John](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children).
   Thanks for the suggestion!
 * **Enhancement:** [Thumber.co](https://thumber.co) authentication secret is no
   longer output in the options
    dump on the admin settings tab, removing the possibility
   of this information being inadvertently printed in the support forum.

#### 4.1.14

 * **Bug Fix:** The handling of saving [Thumber.co](https://thumber.co) subscriptions
   was broken for some use cases.
    The logic has been updated to work correctly 
   in all cases.

#### 4.1.13

 * **Enhancement:** HostGator users were noticing an issue where HTTP connection
   failures would show up while Document
    Gallery was enabled. This resulted in 
   symptoms like not being able to update plugins. This release modifies behavior
   to try and bypass this HostGator shortcoming. Work is still being done working
   with HostGator to try and identify a more complete resolution.

#### 4.1.12

 * **Bug Fix:** Resolves issues where the visual editor gallery preview was missing
   for a small subset of shortcode types.

#### 4.1.11

 * **Bug Fix:** Resolves bug that resulted in various issues, including Jetpack 
   and some core WordPress functionality
    not working correctly.

#### 4.1.10

 * **Bug Fix:** Resolves drag/drop issues in the meida manager.

#### 4.1.9

 * **Bug Fix:** Addresses issues with the IMagick thumbnail generation.
 * **Enhancement:** Handling thumbnail generation for image attachments better (
   should be faster & more reliable).

#### 4.1.8

 * **Bug Fix:** There was a minor bug in how thumbnails for image attachments were
   being generated. It has been addressed.

#### 4.1.7

 * **Bug Fix:** There was a minor issue on some admin pages that has been resolved.

#### 4.1.6

 * **Enhancement:** Added warning to plugins page when a PHP version < 5.3 is being
   used.
 * **Bug Fix:** Resolves a “class not found” error.

#### 4.1.5

 * **Bug Fix:** For a subset of the users upgrading from `4.0` to `4.1.x`, the thumbnail
   images will have been corrupted
    during the upgrade process. This release addresses
   the problem.

#### 4.1.1 & 4.1.2 & 4.1.3 & 4.1.4

 * **Bug Fix:** Resolves various errors reported following `4.1` release.

#### 4.1

 * **Enhancement:** At long last, support for Microsoft Office files (Word, PowerPoint,
   Publisher, Visio), as well as a
    boat-load of [other formats](https://www.thumber.co/about#filetypes),
   has been re-added to Document Gallery by way of integration with the [Thumber.co](https://www.thumber.co)
   service. For a small fee you can generate images for all of your attachments 
   using a service designed specifically to work well with Document Gallery. **For
   a limited time, Thumber.co is offering a free 7-day trial of the basic subscription.
   If you don’t like it, all you have to do is cancel and you won’t pay a penny.
 * **Enhancement:** The pagination footer now includes more than just “prev” and“
   next”, allowing for quicker navigation
    of long multi-page galleries. Additionally,
   the pagination footer will no longer be included if pagination is enabled, but
   there are less than a page-length’s worth of attachments in the gallery.
 * **Enhancement:** Massive rewrite of some core logic that had become unmaintainable.
   This will mean nothing to most
    users, with the noted exception that if you were
   using the `dg_thumbers` filter you’ll need to change some things. If 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 filter to map to the new expected values.

#### 4.0

 * **Enhancement:** The WordPress visual editor now displays a full gallery preview.
 * **Enhancement:** You can now paginate your galleries. This is especially useful
   in large multi-hundred item galleries.
    To enable pagination in your galleries,
   simply use `limit=##`.
 * **Enhancement:** All CSS & JavaScript is now served minified to ensure the fastest
   possible load time for your site.
 * **Enhancement:** When using taxonomies to generate your galleries (eg: media 
   categories) you can now use term slug
    instead of the name. _Thanks andremalenfant
   for suggesting this!_
 * **Enhancement:** The structure of the gallery output has been cleaned up, making
   it easier to style if you chose to
    use custom CSS. _NOTE: This modified structure
   may break existing custom CSS or PHP filtering, so be sure to check this if you’re
   using either of those features.
 * **Bug Fix:** The storage of the DG thumbnail cache was very broken. Due to how
   the cache was originally designed, it
    ran into issues at large scale and on 
   busy sites, which resulted in difficult to track bugs. The entire storage mechanism
   for the cache has been rewritten from the ground up to address this issue, which
   will result in faster gallery generation and more reliable performance.
 * **Bug Fix:** In the thumbnail management tab of the DG settings, sorting by title
   was broken. This has been fixed.
 * **Bug Fix:** `Limit` was not working in cases where the `ids` or `include` attribute
   were present. This has been fixed.
 * **Tested Up To:** Document Gallery has been tested in WP 4.4 beta.

**NOTE: All earlier changes may be found in the CHANGELOG.md file.**

## Meta

 *  Version **5.1.0**
 *  Last updated **4 months ago**
 *  Active installations **9,000+**
 *  WordPress version ** 6.1 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 5.6 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/document-gallery/), [Finnish](https://fi.wordpress.org/plugins/document-gallery/),
   [Russian](https://ru.wordpress.org/plugins/document-gallery/), and [Ukrainian](https://uk.wordpress.org/plugins/document-gallery/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/document-gallery)
 * Tags
 * [attachments](https://wordpress.org/plugins/tags/attachments/)[documents](https://wordpress.org/plugins/tags/documents/)
   [library](https://wordpress.org/plugins/tags/library/)[pdf](https://wordpress.org/plugins/tags/pdf/)
   [word](https://wordpress.org/plugins/tags/word/)
 *  [Advanced View](https://wordpress.org/plugins/document-gallery/advanced/)

## Ratings

 4.8 out of 5 stars.

 *  [  97 5-star reviews     ](https://wordpress.org/support/plugin/document-gallery/reviews/?filter=5)
 *  [  10 4-star reviews     ](https://wordpress.org/support/plugin/document-gallery/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/document-gallery/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/document-gallery/reviews/?filter=2)
 *  [  4 1-star reviews     ](https://wordpress.org/support/plugin/document-gallery/reviews/?filter=1)

[Add my review](https://wordpress.org/support/plugin/document-gallery/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/document-gallery/reviews/)

## Contributors

 *   [ Dan Rossiter ](https://profiles.wordpress.org/danrossiter/)
 *   [ demur ](https://profiles.wordpress.org/demur/)

## Support

Issues resolved in last two months:

     0 out of 2

 [View support forum](https://wordpress.org/support/plugin/document-gallery/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](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)