Linux 软件免费装
Banner图

ACF My Media Cluster

开发者 kionae
更新时间 2026年1月8日 01:10
PHP版本: 3.6.0 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

media pdf documents acf downloads download-files

下载

1.2.12 1.2.11 1.2.9 1.2.10

详情介绍:

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. 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: 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.

安装:

  1. Copy the acf-media-cluster folder into your wp-content/plugins folder
  2. Activate the ACF My 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

更新日志:

1.2.12 1.2.11 1.2.10 1.2.9 1.2.8 1.2.7 1.2.6 1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.0