前言介紹
- 這款 WordPress 外掛「Media Categories」是 2012-01-15 上架。
- 目前有 400 個安裝啟用數。
- 上一次更新是 2012-12-18,距離現在已有 4520 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.3 以上版本才可以安裝。
- 有 7 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
media | category | categories | media categories | attachment categories |
內容簡介
這個外掛可以讓使用者將類別(或其他分類方式)指定給媒體庫中的項目,並提供簡化的類別元框,讓使用者可以快速搜尋類別。其中的「搜尋類別」欄位可以讓你在輸入時進行搜尋。此功能並非 WordPress 內建,而是借用了 Jason Corradino 的 Searchable Categories 外掛,如果你也希望為文章啟用此功能,可以前往下載他的外掛。
自從 WordPress 3.5 開始支援檔案附屬分類功能,將分類元框新增至檔案編輯器的工作現在已經完全由 WordPress 所處理。這樣非常好,現在我們可以使用真正的分類元框,開發團隊也接受了我的修補程式,解決了這個外掛程式中的一些困擾。Media Categories 1.5 利用了新的 Media Modal,讓你可以直接在彈跳視窗中直接編輯圖片的類別,我也解決了一些長時間存在的 shortcode gallery 顯示問題。
更新紀錄
自版本 1.5:支援 WordPress 3.5 新功能,將變更元框新增至新的 Media Modal。修復 shortcode gallery 的呈現效能,仍然支援 WordPress 3.3.x 至 3.4.x。
自版本 1.4:此外掛可以為任何數量的分類建立多個元框。
自版本 1.3:新增篩選器以允許開發人員自行設定使用的分類方式。詳情請見「其他注意事項」中的「Taxonomy Filter Usage」。
自版本 1.2:此外掛擴充了 WordPress 內建的 shortcode,使其加入了「category」參數。更多細節請見「其他注意事項」中的「Shortcode Usage」。
Shortcode 使用
一般的 Shortcode 使用
此外掛使用現有的 shortcode 以顯示圖片,並加入了「category」參數。
傳遞給'category'參數的值可以是categoryslug或term_id。
或
重要提醒:當傳遞'category'參數時, shortcode 會忽略目前的文章和只載入分類中的所有圖片。以上的語法將檢索任何被指定為「my-category-slug」或「term id #12」的圖片,而不論這些圖片是否附加在目前的文章中。
如果要在文章內(甚至是目前的文章)進行查詢,必須明確地添加文章 ID,寫法如下:
此 shortcode 會檢索所有被歸類為「my-slug-category」的圖片,並且它們都附加在文章 #43 上。
除了上述行為, shortcode 應該與內建的 shortcode 完全一致。當未使用「category」參數時,id參數將與其它 shortcode 相同。欲了解有關使用內建 gallery shortcode 請參閱 codex 網站。
其它分類方式的 Shortcode 使用
如果開發人員在實作此外掛時使用了mc_taxonomy篩選器來修改使用的分類方式,可以參閱「其他注意事項」中的「Taxonomy Filter Usage」。
原文外掛簡介
Allows users to assign categories (or other taxonomy terms) to items in their Media Library with a clean and simplified, searchable version of the standard category meta box.
The “Search Categories” field allows you to narrow your search for a category as you type – this functionality is not native to WordPress but is instead borrowed from Jason Corradino’s
Searchable Categories plugin. If you would like to enable this feature for your posts
download his plugin here
Since WordPress 3.5 now supports attachment taxonomy, the work of adding a metabox to the attachment editor is happening entirely inside of WordPress. This is great, and we now have true metaboxes for taxonomy – they core team has also accepted my patches which caused several headaches for this plugin. Media Categories 1.5 takes advantage of the new Media Modal – with this plugin, you can now edit a images categories directly from the modal screen. I’ve also fixed some long standing bugs with the shortcode gallery functionality.
Updates
Since version 1.5 : Supports the new WordPress 3.5 by adding the metabox to the new Media Modal. Also fixed bugs in the gallery shorcode behavior. All while still supporting 3.3.x – 3.4.x
Since version 1.4 : This plugin allows for multiple metaboxes to be created for any number of taxonomies.
Since version 1.3 : A filter has been added to allow developers to modify which taxonomy is being used. See ‘Other Notes’ > ‘Taxonomy Filter Usage’ for details
Since version 1.2 : This plugin extends the native shortcode of WordPress so that it has a ‘category’ parameter. See the “Shortcode Usage” under “Other Notes” for more details.
Shortcode Usage
Normal Shortcode Usage
This plugin takes advantage of the existing shortcode for showing images by adding the 'category' parameter.
The value passed to the 'category' parameter can be either the category slug, or the term_id.
OR
Its important to note that when passing the 'category' parameter, the shortcode will by default ignore the current post
and simply try to include all images from the category. The syntax above will retrieve any images that are assigned
to 'my-category-slug' a.k.a term id #12, regardless of whether or not those images are attached to the current post.
To query within a post (even the current post), you’ll need to explicitly add the post id as such…
This shortcode will retrieve any images attached to post #43 that are categorized as 'my-slug-category'.
Aside from this behavior, the shortcode should behave exactly as it does by default with the built-in shortcode.
The id parameter will behave as normal when the category parameter is not invoked.
For more information on using the built-in gallery shortcode checkout the codex page.
Other Taxonomy Shortcode Usage
If a developer implementing this plugin has made use of the mc_taxonomy filter to modify which taxonomy
this plugin uses for attachments, then the name of that particular taxonomy will need to be used in place of category
as the shortcode parameter. For example, if you applied ‘Post Tags’ to your images then users should use the post_tag parameter
in the Gallery Shortcode.
OR
[Warning: nerdy developer stuff ahead]
Multiple Taxonomy Metaboxes *NEW!*
Since 1.4 this plugin allows developers to create metaboxes for any number of taxonomies. While previous the previous version allowed
developers to change the taxonomy being used, it still only allowed a single taxonomy metabox to be generated. With 1.4, that has changed.
All a developer needs to do, is create a new instance of the Media_Categories class and pass their desired taxonomy as an argument.
$my_custom_media_metabox = new Media_Categories('my_custom_taxonomy');
Thats it!, nothing else to it, the plugin will take care of the rest. You can create as many instances as you like – just make sure to be careful
when doing this in conjunction with the mc_taxonomy filter – always check the current taxonomy.
Obviously this works with any taxonomy, including built-in taxonomies such as ‘post_tag’, ‘link_categories’,
and yes, even ‘nav_menu’. I’ll leave it to you developers out uses for that.
Taxonomy Filter Usage: ‘mc_taxonomy’
Note: Since 1.4, this plugin allows developers to generate any number of metaboxes, for any number of different taxonomies. Because of this,
it is important that when filtering the taxonomy, developers conditionally check the current taxonomy before returning a different – otherwise
the filter would override all instances of the plugin’s metaboxes with the same taxonomy. The examples below have been changes accordingly
Since version 1.3, the Media Categories plugin includes a filter allowing developers to modify the taxonomy being used.
Changing the taxonomy will automatically change all the labels used around the metabox, and change the way the Gallery Shortcode
works so that it accommodates whatever taxonomy has been chosen.
The tag for this filter is 'mc_taxonomy', and usage could not be simpler.
add_filter('mc_taxonomy', 'mc_filter_taxonomy');
function mc_filter_taxonomy($taxonomy){
if($taxonomy == 'category'){
$taxonomy = 'post_tag';
}
return $taxonomy
}
The above code will swap out all references to ‘category’ with appropriate (properly pluralized) references to the ‘post_tag’ taxonomy.
It will also change the way the Gallery Shortcode works to use your chosen taxonomy.
Important (potential gotchas)
The category parameter for the Gallery Shortcode will be changed by using this filter, so that instead of category is will by your_taxonomy. In the case above with tags,
you would write a shortcode as such. OR .
If using a Custom Taxonomy with this plugin, be sure to assign values to the labels for proper pluralization and context
Related Plugin
Checkout this great plugin for Searchable Categories by Jason Corradino, whose javascript I use in this plugin.
I believe this very simple functionality should be a part of the standard categories metabox in core.
While I do not employ the plugin directly, the javascript used for filtering/searching is in fact derived with
consent, and a few modifications from that plugin. To enable this feature on all your category metaboxes, install the
Searchable Categories plugin.
Searchable Categories by Jason Corradino
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Media Categories」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.3.1 | 1.4.1 | trunk |
延伸相關外掛(你可能也想知道)
Safe SVG 》Safe SVG 可以讓你安心地在 WordPress 中上傳 SVG 檔案!, 它能夠讓你允許上傳 SVG 檔案的同時,確保它們已經經過消毒以防止 SVG/XML 弱點影響你的網站。此外...。
FileBird – WordPress Media Library Folders & File Manager 》Media Folder 是史上最佳的 WordPress 外掛,可讓您使用資料夾對媒體庫進行分類。, 我們可以使用拖放式組織方式整理 WordPress 媒體庫資料夾。, 試用 | 升級...。
Media Cleaner: Clean your WordPress! 》Media Cleaner 是一個強大的外掛,它可以幫助你清理 WordPress 媒體庫中未使用的媒體條目和文件,以及修復損壞的條目。內置回收站功能讓你可以在永久刪除之前...。
Default Featured Image 》在媒體設定頁面上新增一個預設的特色圖像。如果沒有設定任何特色圖像,這個預設的特色圖像就會顯示。就這麼簡單。, 查看常見問題以獲取基本問題資訊。, 如果...。
Add From Server 》這個外掛提供有限的支援。請不要期望有太多新功能或修正 bug。功能可能隨時被移除。, Add From Server 外掛旨在幫助緩解不好的網站主機所造成的困擾,讓您可...。
Media Library Assistant 》媒體庫助手提供多個增強功能,方便管理媒體庫,其中包括:, , , , [mla_gallery] 短碼,在文章、頁面或自訂文章類型中使用,添加圖片和/或其他媒體庫項目(...。
Reveal IDs 》WordPress 2.5版本發佈後,所有管理頁面的ID都被刪除了。這應該是因為普通用戶不需要它們。但對於高級WordPress用戶和開發人員來說,這些ID對某些外掛或模板...。
Phoenix Media Rename 》通過使用「Phoenix Media Rename」外掛,將您的媒體檔案重新命名,極大地提高您的 SEO。, 在Phoenix Media Rename 官方頁面上提供了完整的使用和設置指南。。
Media File Renamer: Rename for better SEO (AI-Powered) 》從儀表板直接重命名和移動檔案,可以逐個或批量進行操作,還可以設置自動重命名檔案的功能,提高 SEO、整理 WordPress、讓生活更美好。如需更多信息,請訪問...。
Easy Watermark 》Easy Watermark 可以在圖片上傳到 WordPress 媒體庫時自動加上浮水印。您還可以手動添加浮水印到現有的圖片(全部一次或每個圖片)。浮水印可以是圖像、文字...。
Clean Image Filenames 》這個外掛可以在您上傳至媒體庫時自動將檔名中的語言重音符號轉換。轉換後的字符將會變成網頁和伺服器友好、無語言重音的字元。, 功能, , 將瑞典語、丹麥語、...。
WP User Avatars 》允許註冊使用者上傳並選擇自己的頭像。, 建議外掛, 如果您喜歡這個外掛,您可能會喜歡以下這些外掛!, , WP User Profiles, WP User Activity, WP User Avata...。
Media Sync 》您可以掃描所有在uploads目錄中的檔案,並查看哪些檔案實際上在媒體庫中,哪些檔案只是停留在那裡。然後,您可以選擇要將哪些檔案導入數據庫,從而使它們在媒...。
Compact WP Audio Player 》Compact WordPress Audio Player 插件是一個基於 HTML5 + Flash 混合的 WordPress 外掛,可以透過使用 shortcode 在 WordPress 文章或頁面中嵌入 mp3 音頻文...。
Media Library Categories 》此外掛可允許在 WordPress 媒體庫中使用分類。啟用後,媒體庫中會顯示下拉式的分類清單。, 您可以使用大量動作進行多項目的分類更改、新增或移除分類。, 在使...。