Title: Documents Shortcode
Author: Dougal Campbell
Published: <strong>2012 年 9 月 11 日</strong>
Last modified: 2015 年 8 月 26 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/documents-shortcode.svg)

# Documents Shortcode

 作者：[Dougal Campbell](https://profiles.wordpress.org/dougal/)

[下载](https://downloads.wordpress.org/plugin/documents-shortcode.1.0.1.zip)

 * [详情](https://cn.wordpress.org/plugins/documents-shortcode/#description)
 * [评价](https://cn.wordpress.org/plugins/documents-shortcode/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/documents-shortcode/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/documents-shortcode/#developers)

 [支持](https://wordpress.org/support/plugin/documents-shortcode/)

## 描述

By adding a simple `[documents]` shortcode in your post or page, you get a
 list
of all documents (non-image/audio/video) attached. Each item in the document list
can be styled with CSS to indicate different document types based on file extension(
e.g., .doc, .pdf, etc).

## 安装

Copy the documents-shortcode folder and its contents to your wp-content/plugins

directory, then activate the plugin. Or better yet, use the built-in `Add New` feature
under your Dashboard’s `Plugins` menu.

There is no configuration. Just type the `[documents]` shortcode into your
 posts
or pages to generate a list of attached files.

## 常见问题

  Where is the settings page?

There is no settings page. Just upload attachments to a post or page, and put
 the`[
documents]` shortcode where you wish the list of attachments to appear.

  How can I limit which attachments are listed?

There are two attributes you can use with the shortcode to control which
 attached
documents are listed: `mimetype` and `ext`.

The default match is for mimetype `application/*`. For other types, you will
 need
to specifically override that attribute.

Examples:

    ```
    Just .XLS files:
          [documents ext="xls"]

    All .DOC, .DOCX, or .PDF files:
          [documents ext="doc,docx,pdf"]

    Only 'video' types with a .MOV extension:
          [documents mimetype="video" ext="mov"]

    Just application/pdf mimetypes:
          [documents mimetype="application/pdf"]

    All attached documents, regardless of type:
          [documents mimetype="*"]
    ```

  I got an error trying to upload a file!

If WordPress tells you that a file failed to upload due to an error (“Sorry,
 this
file type is not permitted for security reasons.”), you may need to adjust the list
of allowed file extensions. For more information on how to do this, see:

    ```
    https://wordpress.org/extend/plugins/ap-extended-mime-types/
    https://wordpress.org/extend/plugins/manage-upload-types/
    http://www.wprecipes.com/wordpress-tip-allow-upload-of-more-file-types
    ```

  How do I change the styling?

See the `dc_documents.css` file for the default styles. Document icons are in
 the`
images` sub-folder of the plugin.

You can override these styles in your theme’s CSS by adding more specific
 selectors.
For example, you could change the font used for the file titles in posts with a 
rule similar to this:

    ```
        .post ul.dc_documents li a { font-family: Courier,monospace; }
    ```

  Why don’t my attached images appear in the documents list?

By default, images are filtered out of the list (because, that’s what
 galleries
are for, right?). If you want to list _all_ attached documents, with no filtering,
just say so:

    ```
        [documents mimetype="*"]
    ```

  What file types are supported?

_Technically_, any file type that WordPress will allow you to upload as an
 attachment(
see above). More specifically, there are icons included for the following types 
of files:

    ```
    PDF: `.pdf`
    MS Word: `.doc`, `.docx`
    MS Excel: `.xls`, `.xlsx`
    MS PowerPoint: `.ppt`, `.pptx`
    MS Visio Diagrams: `.vsd`, `.vsdx`
    MS Access Database: `.mdb`, `.mdbx`
    ZIP: `.zip`
    ```

Any other extension will display a generic text document icon. I realize this
 list
is slanted towards Microsoft applications, but that’s just due to the original plugin
usage. Other extension => icon mappings will be added in the future, and I am open
to suggestions.

  Can you make the icon bigger/smaller?

At this time, the only supported icon size is 32 x 32 pixels.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Documents Shortcode」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Dougal Campbell ](https://profiles.wordpress.org/dougal/)

[帮助将「Documents Shortcode」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/documents-shortcode)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/documents-shortcode/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/documents-shortcode/)，或通过[RSS](https://plugins.trac.wordpress.org/log/documents-shortcode/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/documents-shortcode/)。

## 更新日志

= 1.0.1=
 * Allow CSS URL to be filtered.

#### 1.0

 * Initial release. 2012-09-10

## 额外信息

 *  版本 **1.0.1**
 *  最后更新：**11 年前**
 *  活跃安装数量 **80+**
 *  WordPress 版本 ** 2.5 或更高版本 **
 *  已测试的最高版本为 **4.3.34**
 *  语言
 * [English (US)](https://wordpress.org/plugins/documents-shortcode/)
 * 标签
 * [documents](https://cn.wordpress.org/plugins/tags/documents/)[files](https://cn.wordpress.org/plugins/tags/files/)
   [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)[shortcode-only](https://cn.wordpress.org/plugins/tags/shortcode-only/)
 *  [高级视图](https://cn.wordpress.org/plugins/documents-shortcode/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/documents-shortcode/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/documents-shortcode/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/documents-shortcode/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/documents-shortcode/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/documents-shortcode/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/documents-shortcode/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/documents-shortcode/reviews/)

## 贡献者

 *   [ Dougal Campbell ](https://profiles.wordpress.org/dougal/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/documents-shortcode/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://dougal.gunters.org/donate)