內容簡介
使用 Remove Extra Media 外掛可以將多餘的媒體附件從選定的文章類型中刪除。
在我的使用情況中,我的測試人員小工具在某些情況下,出現了多達 7 個與之相關的媒體附件。我想要一個快速的方法來清理這些多餘的附件。考慮到一個測試人員應該只有一個特色圖像或媒體附件,所以我只是刪除了所有其他的。
此工具通過刪除附件關係來運作,因為這樣可保存媒體文件,以防它被其他附件使用。使用 wp_delete_attachment 會刪除媒體文件,這是應該避免的。
主要功能
API
Ajax 基於處理的畫面
媒體不被刪除,僅是從文章類型的項目中解除關聯
設置匯出/匯入
設置畫面
可變的允許媒體數量
設置選項
一般
文章類型 - 從中刪除多餘媒體的文章類型。
媒體數量限制 - 限制所選文章類型的媒體項目數量。計數包括精選圖像。
測試
偵錯模式 - 為測試目的绕过 Ajax 控制器,直接處理 posts_to_import。
要匯入的文章 - 文章 ID 的 CSV 列表,例如 '1,2,3'。
跳過匯入文章 - 不要匯入文章 ID 的 CSV 列表,例如 '1,2,3'。
匯入限制 - 對於限制的文章進行測試很有用。0 或空白表示不限制。
相容性和重置
匯出設置 - 這是您當前設置的序列化格式。複製內容以備份您的設置。
匯入設置 - 在此處貼上新的序列化設置以覆蓋當前配置。
在刪除時刪除外掛數據? - 刪除所有 Remove Extra Media 的數據和選項。
重置為預設? - 勾選此框以將選項重置為其預設值
筆記
待確認。
API
閱讀 Remove Extra Media API。
本地化
如果尚未進行本地化,您可以將此外掛本地化為自己的語言。本地化文件 remove-extra-media.pot 可在此外掛的 languages 文件夾中找到。翻譯完成後,請發送本地化文件以便包含在外掛中。
我該如何本地化?
由 Ognjen Djuraskovic 翻譯的塞爾維亞語
由 Ognjen Djuraskovic 翻譯的西班牙語
外掛標籤
開發者團隊
原文外掛簡介
Use Remove Extra Media to remove extra media attachments from your selected post types.
In my use case, my testimonials widgets post types in some cases, for whatever reason, had up to 7 extra media attachments related to them. I wanted a quick way to clear those excess out. Considering that the only image or media attachment a testimonial should have was the featured, I simply removed all the others.
This tool works by removing the attachment relationship as this saves the media file in case it’s used by other attachments. Using wp_delete_attachment would delete the media file, which is something to avoid.
Primary Features
API
Ajax based processing screen
Media isn’t deleted, only unattached from post type entry
Settings export/import
Settings screen
Variable allowed media count
Settings Options
General
Post Type – Post type to remove excess media from.
Media Limit – Number of media items to limit selected post types to. Count includes featured image.
Testing
Debug Mode – Bypass Ajax controller to handle posts_to_import directly for testing purposes.
Posts to Import – A CSV list of post ids to import, like ‘1,2,3’.
Skip Importing Posts – A CSV list of post ids to not import, like ‘1,2,3’.
Import Limit – Useful for testing import on a limited amount of posts. 0 or blank means unlimited.
Compatibility & Reset
Export Settings – These are your current settings in a serialized format. Copy the contents to make a backup of your settings.
Import Settings – Paste new serialized settings here to overwrite your current configuration.
Remove Plugin Data on Deletion? – Delete all Remove Extra Media data and options from database on plugin deletion
Reset to Defaults? – Check this box to reset options to their defaults
Notes
TBD
API
Read the Remove Extra Media API.
Localization
You can translate this plugin into your own language if it’s not done so already. The localization file remove-extra-media.pot can be found in the languages folder of this plugin. After translation, please send the localized file for plugin inclusion.
How do I localize?
Serbian by Ognjen Djuraskovic
Spanish by Ognjen Djuraskovic
