Changeset 3328296
- Timestamp:
- 07/15/2025 01:54:47 PM (9 months ago)
- Location:
- acf-my-media-cluster/trunk
- Files:
-
- 3 edited
-
acf-my-media-cluster.php (modified) (1 diff)
-
includes/render_field.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-my-media-cluster/trunk/acf-my-media-cluster.php
r2978828 r3328296 3 3 Plugin Name: ACF My Media Cluster 4 4 Description: An extension for the Advanced Custom Fields plugin, which adds the ability to create groups of media files for download on a page/post/custom post type. Based on an add-on created by Navneil Naicker and Download Attachments by dFactory. 5 Version: 1.2.1 05 Version: 1.2.11 6 6 Author: Nikki Blight 7 7 Author URI: http://nlb-creations.com -
acf-my-media-cluster/trunk/includes/render_field.php
r2969412 r3328296 1 <?php 1 <?php 2 2 /* Name: render_field.php 3 3 * Renders the media cluster field on the post edit page … … 5 5 */ 6 6 7 // exit if accessed directly8 if( ! defined( 'ABSPATH' ) ) exit;7 // exit if accessed directly 8 if( ! defined( 'ABSPATH' ) ) exit; 9 9 10 $key = preg_replace('/[^a-z0-9_]/', '', $field['key']);11 $fname = preg_replace('/[^a-z0-9_]/', '', $field['_name']);12 $acf_mc_attachment_ids = array_filter(explode(',', get_field($fname)));13 14 if( !empty($acf_mc_attachment_ids) and count($acf_mc_attachment_ids) > 0 ){15 $data = get_posts(array(16 'post__in' => $acf_mc_attachment_ids,17 'post_type' => 'attachment',18 'orderby' => 'post__in',19 'order' => 'ASC',20 'numberposts' => -121 ));22 } else {23 $data = array();24 }10 $key = preg_replace('/[^a-z0-9_]/', '', $field['key']); 11 $fname = preg_replace('/[^a-z0-9_]/', '', $field['_name']); 12 $acf_mc_attachment_ids = array_filter(explode(',', get_field($fname))); 13 14 if( !empty($acf_mc_attachment_ids) and count($acf_mc_attachment_ids) > 0 ){ 15 $data = get_posts(array( 16 'post__in' => $acf_mc_attachment_ids, 17 'post_type' => 'attachment', 18 'orderby' => 'post__in', 19 'order' => 'ASC', 20 'numberposts' => -1 21 )); 22 } else { 23 $data = array(); 24 } 25 25 ?> 26 26 <div id="acf-mc-nonce-container"> … … 56 56 acf_mc_cluster_field_group(false, $item->ID, $fname, $key, $url, $title, $type, $size, $downloads, true, false, $index+1); 57 57 } 58 acf_mc_cluster_field_group(false, 0, $fname, $key, null, null, null, null, null, false, true, count($data) + 1);58 acf_mc_cluster_field_group(false, 0, $fname, $key, '', '', '', '', '', false, true, count($data) + 1); 59 59 } 60 60 ?> -
acf-my-media-cluster/trunk/readme.txt
r3132817 r3328296 4 4 Requires at least: 3.6.0 5 5 Tested up to: 6.6 6 Stable tag: 1.2.1 06 Stable tag: 1.2.11 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 87 87 == Changelog == 88 88 89 = 1.2.11 = 90 *Fixed a PHP deprecation issue. 91 89 92 = 1.2.10 = 90 93 * Fixed a javascript issue that prevented the user from updating the selected file before saving in some circumstances.
Note: See TracChangeset
for help on using the changeset viewer.