前言介紹
- 這款 WordPress 外掛「ACF My Media Cluster」是 2023-09-19 上架。
- 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
- 上一次更新是 2024-08-08,距離現在已有 269 天。
- 外掛最低要求 WordPress 3.6.0 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
kionae |
外掛標籤
acf | pdf | media | documents | download files |
內容簡介
- ACF My Media Cluster是Advance Custom Fields的擴展,可以在頁面/文章/自定義文章類型上創建媒體文件的下載群組。
- 該插件提供了簡單易用的短碼和輔助函數,如果您希望自定義輸出,可以使用它們。
- 可以在ACF界面中直觀地創建自己的字段。
- 將字段分配給文章類型。
- 通過簡單友好的輔助函數輕鬆加載數據,或者只需使用短碼即可。
- 使用原生WordPress自定義文章類型來提供使用方便和快速處理。
- 使用原生WordPress元數據提供使用方便和快速處理。
- 可以向文章、頁面和自定義文章類型添加多個媒體文件,還可以從這個界面修改標題、說明和描述。
使用方法:
- 使用下面的輔助函數從數據庫中取出數據。該函數將返回一個數組。輔助函數需要三個參數。
- 例如:假設我們想從當前頁面中提取年度報告。
- 返回的數據將是一個數組,您可以遍歷該數組並根據需要使用數據。
- 第三個參數是輔助函數的選項,它接受一個數組。您可以傳遞以下參數。
-在編輯器中,將以下短碼添加到您希望媒體出現的位置。
-該短碼接受以下參數。
相容性:
- ACF My Media Cluster與ACF 6和ACF 5兼容。
- 這個ACF字段與iThemes Security插件兼容,但在系統調整的「PHP執行」下的「禁用插件中的PHP」選項必須取消勾選。
插件來源:
- 這個插件是基於Navneil Naicker的ACF Media Cluster插件開發的。
- 它也從dfactory的Download Attachments插件中獲得了一些靈感,不過該插件已經不存在了。
問題和答案:
問題1:ACF My Media Cluster 是做什麼用的?
答案1:ACF My Media Cluster是Advance Custom Fields的擴展,可以在頁面/文章/自定義文章類型上創建媒體文件的下載群組。
問題2:ACF My Media Cluster提供了哪些使用方式?
答案2:ACF My Media Cluster提供了簡單易用的短碼和輔助函數可以自定義輸出,也可以在ACF界面中直觀地創建字段。
問題3:如何從數據庫中提取數據?
答案3:可以使用下面的輔助函數從數據庫中提取數據,該函數返回一個數組。
問題4:ACF My Media Cluster與哪些版本相容?
答案4:ACF My Media Cluster與ACF 6和ACF 5相容。
問題5:ACF My Media Cluster和哪個插件有相似之處?
答案5:ACF My Media Cluster受到了Navneil Naicker的ACF Media Cluster插件和dfactory的Download Attachments插件的啟發。
原文外掛簡介
ACF My Media Cluster is an extension for Advance Custom Fields which adds the feature to create groups of media files for download on a page/post/custom post type. The plugin does come with both a simple to use shortcode and a helper function if you wish to customize your output.
* Visually create your Fields in the ACF interface.
* Assign your fields to post types
* Easily load data through a simple and friendly helper function, or just use the shortcode.
* Uses the native WordPress custom post type for ease of use and fast processing
* Uses the native WordPress metadata for ease of use and fast processing
* Add multiple media files to your posts, pages, and custom post types. You can also modify title, caption and description from this interface.
Usage
Use the helper function below to pull data from the database. The function will be return an array. The helper function takes in 3 parameters.
acf_media_cluster(string|required $acf_field_name, int $postID, array $options);
Example
Based on the helper function above. Let say we want to pull annual reports from current page.
acf_media_cluster('annual_reports', get_the_ID());
The data that will be return will be an array. You can then loop over the array and use the data anyway you want.
$ap = acf_media_cluster('annual_reports', get_the_ID());
if( !empty($ap) ){
foreach($ap as $item){
var_dump($item); //Use the data as you wish
}
}
Options
The 3rd parameter of the acf_media_cluster(string|required $acf_field_name, int $postID, array $options); helper function is options which takes in an array. You can pass the following:
acf_media_cluster('annual_reports', get_the_ID(), array(
'orderby' => 'post__in',
'order' => 'ASC'
));
For acceptable values for order and orderby, please refer to https://developer.wordpress.org/reference/functions/get_posts/
Shortcode
In your editor, add the following shortcode where you want the media to appear.
[acf-media-cluster field_name="my_media_field"]
The shortcode accepts the following parameters.
string|required $field_name – Which ACF field name should be used
string $container_id – Wrap the output with your custom CSS ID name
string $container_class – Wrap the output with your custom CSS class name
string $skin – Do you want default CSS styling to apply? yes|no
string $format – html format for the output. table|list
string $title – a title wrapped in an container tag. Leave blank for no tag.
string $title_container – html tag to wrap the title in, with no brackets. “h3” is default.
string $show_meta – Do you want to display file metadata (size, downloads, date)? yes|no
Compatibility
This ACF field type is compatible with:
* ACF 6
* ACF 5
This ACF field is compatible with the iThemes Security plugin, but you must uncheck the option for “Disable PHP in plugins” under PHP Execution in System Tweaks.
Credits
This plugin is based on ACF Media Cluster by Navneil Naicker. (https://wordpress.org/plugins/acf-media-cluster/)
It also takes some inspiration from the Download Attachments plugin by dfactory, which sadly no longer exists.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「ACF My Media Cluster」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
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 媒體庫中使用分類。啟用後,媒體庫中會顯示下拉式的分類清單。, 您可以使用大量動作進行多項目的分類更改、新增或移除分類。, 在使...。