Linux 软件免费装
Banner图

WP Attachments

开发者 Milmor
更新时间 2026年9月1日 04:40
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.2
版权: GPLv2 or later
版权网址: 版权信息

标签

media classicpress list attachments file

下载

5.2.1 5.0.5 5.0.6 3.0.2 3.0.3 3.1 3.1.2 3.1.3 3.1.4 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.4 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.6 3.6.1 3.7 4.0.1 4.0.2 4.1 4.1.1 3.5 4.0 5.0.3 5.0.4 2.0 3 3.0.1 5.0.10 5.1 5.1.1 5.1.2 5.2 5.3 3.1.1 5.0.12 5.3.3 5.3.4 5.0.11 6.0.1 6.0.2 6.0.3

详情介绍:

WP Attachments turns the files you upload to a post into a clean, automatic download list. Attach a file while editing, and it shows up under your content — no manual links, no shortcodes to remember. It also fills the gaps in the WordPress Media Library, letting you attach, unattach and reattach files without leaving the screen you are on. Key features Video Overview

安装:

  1. Install via the WordPress.org plugin directory or upload the files to your server.
  2. Activate the plugin. To customise it, go to Settings → WP Attachments.
  3. While editing a post, page or custom post type you will find the Media Attachments metabox. Extra actions are available in the Media Library: Attach, Unattach and Reattach.

屏幕截图:

  • General settings: list header, display options, download tracker and per post type permissions
  • The same list in context, on a page of a demo site
  • The Media Attachments metabox: manage, preview and reorder files without leaving the editor
  • Attach, Unattach and Re-Attach files straight from the Media Library

常见问题:

How do I hide the attachment list on a specific post or page?

Open the Media Attachments metabox while editing and switch off Display attachments in frontend, at the bottom left. The files stay attached, they are simply not listed on the site. You can also set the default for a whole post type under Settings → WP Attachments → Post Type Permissions.

How do I avoid the same file being listed twice?

Do not insert the link manually. A file uploaded from the editor is attached to the content automatically and listed by WP Attachments, so you can simply close the media popup after uploading.

How do I reorder the files?

Three ways, all of which save straight away:

  • drag a row by the grip on its left;
  • use the Move up / Move down buttons on each row;
  • focus the grip and press the up or down arrow key.

How do I see which files belong to a post?

The Files column in the post and page lists shows how many files each one has. Click the number to open the Media Library filtered to just those files.

Can I change the date format of the list?

Yes, under Settings → WP Attachments → Date Format. It accepts the standard PHP date characters and applies to the %DATE% tag. Leave it empty to follow Settings → General → Date Format.

Does the download counter count everything?

No. It skips browser prefetch requests and known crawlers, and it ignores repeat hits from the same visitor on the same file for a few minutes. Those requests still receive the file, they just do not move the number.

Which files can be previewed in the metabox?

Images, video, audio, PDF and plain text open in a preview dialog. Any other format shows its icon and a download link.

Developer filters

  • wpatt_list_html — the whole list markup ($html)
  • wpatt_before_entry_html — a single entry, before the tags are replaced ($html)
  • wpatt_after_entry_html — a single entry, after the tags are replaced ($html)
  • wpatt_accepted_formats — return a falsy value to hide a file ($mime)
  • wpatt_download_throttle — how long the same visitor is ignored for the same file ($seconds, $attachment_id)
  • wpatt_count_download_request — whether the current request may increment a counter ($countable)
Examples function my_custom_function( $html ) { // Alter the final HTML return $new_html; } add_filter( 'wpatt_list_html', 'my_custom_function' ); function my_pdf_only( $mime ) { // Only show PDFs in the list return $mime === 'application/pdf'; } add_filter( 'wpatt_accepted_formats', 'my_pdf_only' ); // Count each visitor at most once per hour add_filter( 'wpatt_download_throttle', function () { return HOUR_IN_SECONDS; } ); There is also wpatt_get_attachments_html( $parent_id ), which returns the list for any parent ID without going through the the_content filter.

更新日志:

6.0.3 2026-08-31 5.3.4 2026-03-14 5.3 2026-02-02 5.2.1 2026-01-19 5.2 2025-06-09 5.1 2025-05-25 5.0.12 5.0.6 2023-02-15 5.0.4 2021-10-20 5.0 2020-11-28 4.4.2 2020-04-29 4.4.1 2020-02-20 Version 4.4 18/11/2017 Version 4.3.6 10/01/2017 Version 4.3.4 06/07/2016 Version 4.3.3 02/04/2016 Version 4.3.2 19/02/2016 Version 4.3.1 18/02/2016 Version 4.3 23/12/2015 Version 4.2 02/08/2015 Version 4.1.2 6/07/2015 Version 4.1.1 1/06/2015 Version 4.1 26/04/2015 Version 4.0.2 Version 4.0.1 Version 4.0 Version 3.7 05/03/2015 Version 3.6.1 28/02/2015 Version 3.6 28/02/2015 Version 3.5.6 21/10/2014 Version 3.5.5 05/09/2014 Version 3.5.4 26/07/2014 Version 3.5.3 20/07/2014 Version 3.5.2 15/07/2014 Version 3.5.1 12/07/2014 Version 3.5 09/07/2014 Version 3.4 08/07/2014 Version 3.3 28/03/2014 Version 3.2.3 26/03/2014 Version 3.2.2 12/03/2014 Version 3.2.1 03/03/2014 Version 3.2 03/03/2014 Version 3.1.4 4/11/2013 Version 3.1.3 27/10/2013 Version 3.1.2 27/10/2013 Version 3.1.1 19/10/2013 Version 3.1 15/09/2013 Version 3.0.4 24/08/2013 Version 3.0.3 23/08/2013 Version 3.0.2 23/08/2013 Version 3.0.1 22/08/2013 Version 3.0 22/08/2013 Version 2.0 04/07/2013 Version 1.0 07/01/2012