[WordPress] 外掛分享: ACF Media Cluster

前言介紹

  • 這款 WordPress 外掛「ACF Media Cluster」是 2021-07-27 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2022-11-02,距離現在已有 914 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.6.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

navzme |

外掛標籤

acf | pdf | word | media | images |

內容簡介

ACF 媒體叢集是進階自訂欄位的一個擴充外掛程式,它添加了將多媒體添加到文章/頁面的功能。插件提供了短代碼,或者如果您知道如何編寫代碼,則可以自定義或編寫自己的代碼並根據 ACF 媒體叢集提供的數據使用。

視覺化創建您的自訂欄位
添加多媒體,您還可以將標題、說明和描述修改為任何內容
通過編寫自定義位置規則將您的欄位分配給多個編輯頁面
通過一個簡單友好的 API 輕鬆加載數據
使用本地 WordPress 自訂文章類型,易於使用和快速處理
使用本地 WordPress 元數據,易於使用和快速處理

用法

使用下面的輔助函式從資料庫中提取資料。該輔助函式將返回一個數組。輔助函式接受三個參數。

acf_media_cluster(string|required $acf_field_name, int $postID, array $options);

範例

基於上述的輔助函式。假設我們想要從當前頁面中提取年度報告。

acf_media_cluster('annual_reports', get_the_ID());

將返回的數據為一個數組。現在可以遍歷數組並按照您的方式使用數據。

$ap = acf_media_cluster('annual_reports', get_the_ID());
if( !empty($ap) ){
foreach($ap as $item){
var_dump($item); //按照您的方式使用數據
}
}

選項

acf_media_cluster(string|required $acf_field_name, int $postID, array $options); 輔助函式的第三個參數是指選項,它接受一個陣列。您可以傳遞以下選項。

acf_media_cluster('annual_reports', array(
'orderby' => 'post__in',
'order' => 'ASC'
));

您可以傳遞哪些值用於排序和按什麼排序,請參閱 https://developer.wordpress.org/reference/functions/get_posts/

短代碼

在您的編輯器的文本檢視中,在您希望媒體出現的位置添加以下短代碼。

[acf-media-cluster field_name="discussions" container_id="ml-table" container_class="ml-table2" skin="yes"]

短代碼接受以下參數。

string|required $field_name – 使用哪個 ACF 欄位名稱
string $container_id – 用您的自定義 CSS ID 包裝輸出
string $container_class – 用您的自定義 CSS 類別包裝輸出
string $skin – 您是否希望應用默認的 CSS 樣式。 yes|no

問題

就像任何其他 WordPress 外掛程式一樣,這個外掛程式也可能導致其他主題和外掛程式的問題。如果您在使用此外掛程式時遇到問題,在支援論壇中請求幫助。這樣我們就可以幫助您解決問題,並防止這個問題發生在其他人身上。如果您想直接與我交談,可以通過我的網站 http://www.navz.me/ 聯繫我。

兼容性

此 ACF 自訂欄位類型與:
* ACF 5

原文外掛簡介

ACF Media Cluster is an extension for Advance Custom Fields which adds the feature to add multiple media to post/pages. The plugin does come with shortcode or if you know how to write code then you can customize or write your own code and use the data provided by ACF Media Cluster as you wish.

Visually create your Fields
Add multiple media and you can also modify title, caption and description to anything
Assign your fields to multiple edit pages (via custom location rules)
Easily load data through a simple and friendly API
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

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. Now I can loop over the array and use the data anyway I 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', array(
'orderby' => 'post__in',
'order' => 'ASC'
));

What are the values you can pass for order and orderby, please refer to https://developer.wordpress.org/reference/functions/get_posts/
Shortcode
In the text view of your editor, add the following shortcode where you want the media to appear.
[acf-media-cluster field_name="discussions" container_id="ml-table" container_class="ml-table2" skin="yes"]

The shortcode takes in 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
string $container_class – Wrap the output with your custom CSS class
string $skin – Do you want default CSS styling to apply. yes|no
Issues
Just like any other WordPress plugin, this plugin can also cause issues with other themes and plugins. If you are facing issues making this plugin work on your WordPress site, please do ask for help in the support forum. This way we can help you out and prevent this issue from happening to someone else. If you want to talk to me directly, you can contact me via my website http://www.navz.me/
Compatibility
This ACF field type is compatible with:
* ACF 5

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「ACF 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 媒體庫中使用分類。啟用後,媒體庫中會顯示下拉式的分類清單。, 您可以使用大量動作進行多項目的分類更改、新增或移除分類。, 在使...。

文章
Filter
Apply Filters
Mastodon