Document Repository

Document Repository

Update Aug 26, 2011

Today I pushed out version 0.2.4 which has script fixes for link insertion & cross domain support for IE (tested with 8 & 9). It's the go version. Those two issues with IE were the only things we found since 0.2.3.

Update Aug 11, 2011

Today I pushed out version 0.2.3 which is a release candidate. Essentially everything is done with the plugin but more extensive/wider use may reveal a bug. Updates/additions:

  • Several script fixes
  • filter for uses custom caps with the custom taxonomies document_taxonomy_capabilities
  • If you have selected text in the post editor and insert a document link, the selected text is used as the link text for the document link
  • translation support

Original post

Over the weekend I released the beta version of the Document Repository plugin.I've labeled it as a beta because I have a bit more work to do on it. However, the current version does work and only lacks a few minor things like translation support, etc. Over the next week or so I will be rolling those final touches in. I'll update this post accordingly.

The main goal of the plugin is to provide a central repository of documents for a website using WordPress as a CMS. Many organizations implementing a CMS update their documents on an ongoing basis. Using the default media handling in a WordPress would mean updating URLs to uploaded documents throughout the website's content as new versions of documents were uploaded. The document repository does not contain any workflow, collaboration, version control or approval features. If you are looking for a document authoring collaboration tool, please see WP Document Revisions.

The Document Repository implements a custom post type and custom attachments to achieve document revisioning where the permalink to the latest version of the document persists for the life of the document post (although the permalink is editable). The permalink to the current version of the document is


Earlier versions of the document are also available via permalink


Assuming there is an attachment available for downloading, a request to either of the permalinks above generates a direct download of the associated document.

The Document Repository plugin was developed in collaboration with the University of Mary Washington.


In a single WP install, activate the document repository and any of the included optional plugins you wish.

In a network,

  • activate the document repository on one site in the network. Do not network activate it unless you want all the sites in the network to be document repositories.
  • if you are implementing the custom taxonomies, activate that plugin on the document repository site.
  • if you are implementing the custom roles, activate that plugin on the document repository site.
  • if you are implementing the network extras, network activate that plugin.

The document repository plugin adds a Document post type to the WP dashboard. When editing a document post, enter a title and description/abstract which will be shown in search results in the document repository site. Click on the media button to open the media library. In the media library upload the document file. Once uploaded, click the finish button to return to the Document post.

The custom taxonomy plugin is included as a sample of implementing custom taxonomies with Document posts. It requires a document be given a term from all the custom taxonomies before allowing the document to be published. If you modify the taxonomy plugin to suit your implementation, copy it out of the document-repository folder and rename the PHP class to avoid duplicate classes and having your version overwritten by an update.

The custom roles plugin adds an Roles screen under the Documents menu. Add your roles through this screen. Then edit the site users' profiles and assign the appropriate roles to the editors, authors & contributors. Once these roles are assigned, editors will only have edit permission on their own Document posts and authors & contributors that have the same Document role as they do. Site admins & super admins have access to all the document posts.

The extras plugin adds a media button to the media buttons in the edit post & page screens. Clicking this button opens a custom media screen to a search feature for the document repository. Documents can be searched by text string (same as default WP search), tag and/or custom taxonomy (if active on the document site). An Insert into Post link is provided for each Document.

(Visited 79 times, 1 visits today)
  • Ronald
    Posted at 14:58h, 08 August Reply

    This really looks aewsome, and something I’ve been looking for the last weeks.Will try it out!
    Thanks a lot!!

  • Ronald
    Posted at 15:16h, 09 August Reply

    The Gravityforms-add button appears next to the media button in the admin-post-edit section. Perhaps nicer if this doesn’t happen…
    Am experimenting with the roles. Possible hard to combine with the premium membership plugin…
    I’ll you know.

    Thx and cheers!

    • Ron
      Posted at 15:58h, 09 August Reply

      You’re paying the folks at Gravity forms for support. They are the logical people to ask about issues related to their plugin.

      I’ve never used either Gravity forms or any premium membership plugin, so I’m really not the person you should be asking about those.

      • Ronald
        Posted at 11:24h, 10 August Reply

        Point taken.
        I just thought that, since the other media upload icons were gone in the post-edit section of this simple but effective plugin, you wanted to know so you could perhaps enhance the code.
        Don’t know, I’m no expert in that. That’s why I use perium plugins every once in a while…

        • Ron
          Posted at 11:41h, 10 August Reply

          I just thought that, since the other media upload icons were gone in the post-edit section of this simple but effective plugin, you wanted to know so you could perhaps enhance the code.

          You lost me actually. This plugin removes all but one of the upload buttons in the document post window. In the edit post window it adds one but doesn’t remove any. I’m not sure how that relates to either of the plugins you mentioned.

          • Ronald
            Posted at 18:34h, 11 August

            No problem. I checked and see in both New Document and the Document Edit screen two upload buttons: Media upload and the form icon.
            So the removal goes OK, but it leaves one button extra, and it makes no difference between the windows you mention in your reply.
            Just to let you know, not to nag or be negative.

          • Ron
            Posted at 07:03h, 12 August

            On your local computer search the gravity forms plugin for ‘media_buttons_context’. You should find an add_filter or add_action line.

            If you leave that line in a comment I’ll see if I can come up with a small plugin you can use to remove the GF button on the documents screen.

          • Curtiss Grymala
            Posted at 09:47h, 09 September

            Actually, Ron, this is an issue we’ll need to tackle at UMW, too; so I’ll see if I can find the solution and will share it with you guys once I’ve done so.

  • Diane Mercier
    Posted at 11:17h, 10 August Reply

    Hi Ron,

    Do you have some screenshot or a link to a working sample
    Diane Mercier

    • Ron
      Posted at 11:35h, 10 August Reply

      No I don’t have a link to a working sample. You’ll have to download it and try it. I’m hoping to have a new version out by the end of the day.

  • Benjamin J. Balter
    Posted at 10:06h, 29 August Reply


    Thanks for the shoutout. Agree our plugins are very different. Gave yours a try, and looking forward to future versions. May be some opportunities to collaborate here.

    If you’re interested in more info on WP Document Revisions, I just posted a screencast of a typical use case, and brief overview of top-level features over on the WP Document Revisions page.

    • Ron
      Posted at 10:42h, 29 August Reply

      Hey Ben,

      I haven’t had a chance to get back to looking at document revisions in a couple months (and probably won’t for a while due to some things that have come up offline). The last time I looked at it it was looking really great.

      Excepting FOSS projects, any of the document collaboration implementations I’ve seen have been secured very far away from direct access via the Internet. Typically someone would be responsible for downloading the document from the collaboration site and publishing it on the public facing web site. That’s a place where we might be able to work some magic 🙂

  • Adam J. Blust
    Posted at 15:00h, 06 September Reply

    How would I go about creating display pages for the documents? I would like to use this plugin as the basis for a public document library on my site, organized by categories.

    Adam J. Blust

    • Ron
      Posted at 15:22h, 06 September Reply

      Add a taxonomy that you want to use to organize the display pages and set up the archive page for the taxonomy.

  • A Few Tweaks to the Document Repository Plugin | Ten-321 WordPress Plug-Ins
    Posted at 10:14h, 10 September Reply

    […] seen it, Ron Rennick wrote an amazing plugin for us at University of Mary Washington that lets us manage all of our documents (PDF, Word, Excel, etc.) from a single site in our WordPress network; and then insert links to those documents from within any other site in the network. The plugin […]

  • hogwam
    Posted at 13:07h, 12 October Reply

    great plugin – but I am having an issue with the insert document button.
    it pops the window where I would expect to select or search for the document, but the dialogue is blank.
    I have tested in Firefox 8, Chrome, IE9 and same issue occurs.

    • Ron
      Posted at 13:12h, 12 October Reply

      In Firefox or Chrome, right click the media frame and view source. You’ll probably see an error.The media frame sometimes doesn’t show PHP error messages.

    • Sarah
      Posted at 17:01h, 26 January Reply

      Hi Ron and Adam,

      I am having the same problem with the file insertion pop up window. I’m not sure that I do see an error in the source. Adam, how did you solve your? Ron, any more suggestions for trouble shooting?



      • Ron
        Posted at 17:13h, 26 January Reply

        If you are using WP 3.3 get the development version of the document repository. I haven’t released the new version yet because I’m waiting for testing feedback.

  • Valentin
    Posted at 05:45h, 21 October Reply

    Hey ! What a wonderful plugin.
    I get some troubles… maybe you could help.
    First, permalinks don’t work when wordpress is in a subfolder. Il don’t know how to modify it…
    Second, when I upload a document, I don’t have any message or any view of this document. I mean, the media library for the post is empty…
    But, with your plugin I achieved what I expected to do 😉
    I’m working with the last release of WordPress.

    • Ron
      Posted at 12:27h, 21 October Reply

      For permalinks, are you using the default.

      The media tool/screen for your post area is in the Extras plugin included with the document repository. Activate it and you’ll get an extra media button for inserting documents into posts.

      • Valentin
        Posted at 03:58h, 24 October Reply

        Thank you for your response.
        About the permalinks, I’m using a personnalized syntax, but nothing weird. And, just for the documents, I’m getting the subfolder twice in the url.
        About the media tool/screen… this is a bit different. Extras plugin was activated. When I want to upload, in the media popup, I can choose and upload the file. But there’s nothing else than a “finished” message and no view of any document. But it’s here !!

        • Ron
          Posted at 07:49h, 24 October Reply

          You don’t need to see the document in the media window since it can’t be cropped and otherwise manipulated as media. When you click Finish the window closes & the edit post window is refreshed. The link to the document is in the Revision metabox.

          For the purposes of revisioning it was necessary to remove the document from the media library.

          • Valentin
            Posted at 07:54h, 24 October

            Good to know !!
            As the revision box is misplaced by default (not your fault !), I didn’t see it… now I should be more accurate with the next documents 😉

            Anything about my other problem with the permalinks ? Is it solvable with url rewriting or your code have to be twicked to do the trick ?

          • Ron
            Posted at 09:06h, 24 October

            The rewrites are handling starts on line 488 of document-repository.php.Not sure why your path/base is being doubled.

  • Jim Locke
    Posted at 15:56h, 16 November Reply

    Now I’m starting to feel dumb at this moment. I am new to wordpress (about an 1hr) and added this Doc Repo plugin. I can see where to upload varuious forms of media etc. But for the life of me I can’t see how to upload pdf/docx/xlsx documents. Hopefully someone (Ron) can help me point my mouse in the right direction.


    • Ron
      Posted at 16:50h, 16 November Reply

      The allowed file types are in the network settings screen.

      • Jim Locke
        Posted at 17:25h, 16 November Reply

        now thats what I can’t find, network settings screen

        • Ron
          Posted at 21:56h, 16 November Reply

          In WP 3.2 the network admin link drops down if you click on the howdy, username link in the top right corner.

          • Jim Locke
            Posted at 12:55h, 17 November

            actually it don’t.

            I am logged in as admin and all i get is “your profile” and “log out” (wp 3.2.1)

          • Ron
            Posted at 13:21h, 17 November

            You need to enable the network in WordPress to have access to the network settings page:

            Since your original issue is uploading file types and you asked here instead of at the WP support forums, I assumed you were running a network (which is what all the content on this site is about). Post a thread at and ask there what might be preventing you from uploading MS office documents.

          • Jim Locke
            Posted at 17:41h, 17 November

            Tks Ron. The info you gave me was enough to get the doc repo working. The funny thing is that it pointed out a thing about max filesizes, which there was no perfect answer, but I figured it out. Tks again for your assistance


  • jmcq
    Posted at 16:55h, 07 December Reply

    Hi Ron,
    I would like to change the taxonomies used with this plugin. When you state ‘ If you modify the taxonomy plugin to suit your implementation, copy it out of the document-repository folder and rename the PHP class to avoid duplicate classes and having your version overwritten by an update.’ I am not sure where to copy it to? Duplicate file and rename the class? I apologize I am not that great with php but would love to try and use this. Thank you, it looks like a great plugin 🙂

    Also, if I create other taxonomies in my site, would that cause a conflict with the taxonomies created with this plugin. I have another created but it doesn’t show as a selection choice when I create a new document/post.

    Thanks again.

    • Ron
      Posted at 19:23h, 07 December Reply

      You can copy it to your plugins folder.

      When you register your taxonomy is has to be attached to or associated with the post type(s) when it’s registered that you want it to be associated with. If you are using my samples as a model, that plugin has code for that.

      The only time you’ll have taxonomy conflicts is if two different taxonomies have either the same name or the same rewrite slug.

  • Praveen Rajarao
    Posted at 12:45h, 27 December Reply

    Ron – Has this plugin been updated to support WordPress 3.3. I am getting an error related to media files on extras.php file. Can you check it out for me? Thanks.

    • Ron
      Posted at 09:12h, 28 December Reply

      I’ll be a week or so until I have time to look at it.

      • Mirko
        Posted at 21:39h, 31 January Reply

        How about this 3.3.1 support – your otherwise great plugin shows some strange behaviour with the new upload dialogue …

        • Ron
          Posted at 12:43h, 03 March Reply

          Download the development version. So far I haven’t had any feedback on the development version so I haven’t released it.

          • Pete Jewett
            Posted at 15:45h, 26 April

            I’m testing out your dev version on a mobile site I’m building. Looks good so far.

Post A Comment