Title: ACF Media Cluster
Author: Navneil Naicker
Published: <strong>2021 年 7 月 28 日</strong>
Last modified: 2022 年 11 月 2 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/acf-media-cluster/assets/icon-128x128.png?rev=2579542)

# ACF Media Cluster

 作者：[Navneil Naicker](https://profiles.wordpress.org/navzme/)

[下载](https://downloads.wordpress.org/plugin/acf-media-cluster.zip)

 * [详情](https://cn.wordpress.org/plugins/acf-media-cluster/#description)
 * [评价](https://cn.wordpress.org/plugins/acf-media-cluster/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/acf-media-cluster/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/acf-media-cluster/#developers)

 [支持](https://wordpress.org/support/plugin/acf-media-cluster/)

## 描述

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/](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/](http://www.navz.me/)

#### Compatibility

This ACF field type is compatible with:
 * ACF 5

## 安装

 1. Copy the `acf-media-cluster` folder into your `wp-content/plugins` folder
 2. Activate the ACF Media Cluster plugin via the plugins admin page
 3. Create a new field via ACF and select the Media Cluster type
 4. Read the description above for usage instructions

## 评价

此插件暂无评价。

## 贡献者及开发者

「ACF Media Cluster」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Navneil Naicker ](https://profiles.wordpress.org/navzme/)

[帮助将「ACF Media Cluster」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/acf-media-cluster)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/acf-media-cluster/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/acf-media-cluster/)，或通过[RSS](https://plugins.trac.wordpress.org/log/acf-media-cluster/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/acf-media-cluster/)。

## 更新日志

#### 1.0.0

 * Initial Release.

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**4 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.6.0 或更高版本 **
 *  已测试的最高版本为 **6.1.15**
 *  语言
 * [English (US)](https://wordpress.org/plugins/acf-media-cluster/)
 * 标签
 * [acf](https://cn.wordpress.org/plugins/tags/acf/)[images](https://cn.wordpress.org/plugins/tags/images/)
   [media](https://cn.wordpress.org/plugins/tags/media/)[pdf](https://cn.wordpress.org/plugins/tags/pdf/)
   [word](https://cn.wordpress.org/plugins/tags/word/)
 *  [高级视图](https://cn.wordpress.org/plugins/acf-media-cluster/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/acf-media-cluster/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/acf-media-cluster/reviews/)

## 贡献者

 *   [ Navneil Naicker ](https://profiles.wordpress.org/navzme/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/acf-media-cluster/)