Plugin Directory

Changeset 3328296


Ignore:
Timestamp:
07/15/2025 01:54:47 PM (9 months ago)
Author:
kionae
Message:

1.2.11

*Fixed a PHP deprecation issue.

Location:
acf-my-media-cluster/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • acf-my-media-cluster/trunk/acf-my-media-cluster.php

    r2978828 r3328296  
    33Plugin Name: ACF My Media Cluster
    44Description: 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.10
     5Version: 1.2.11
    66Author: Nikki Blight
    77Author URI: http://nlb-creations.com
  • acf-my-media-cluster/trunk/includes/render_field.php

    r2969412 r3328296  
    1 <?php 
     1<?php
    22/* Name: render_field.php
    33 * Renders the media cluster field on the post edit page
     
    55 */
    66
    7     // exit if accessed directly
    8     if( ! defined( 'ABSPATH' ) ) exit;
     7// exit if accessed directly
     8if( ! defined( 'ABSPATH' ) ) exit;
    99
    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     }
     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
     14if( !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}
    2525?>
    2626<div id="acf-mc-nonce-container">
     
    5656                    acf_mc_cluster_field_group(false, $item->ID, $fname, $key, $url, $title, $type, $size, $downloads, true, false, $index+1);
    5757                }
    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);
    5959            }
    6060        ?>
  • acf-my-media-cluster/trunk/readme.txt

    r3132817 r3328296  
    44Requires at least: 3.6.0
    55Tested up to: 6.6
    6 Stable tag: 1.2.10
     6Stable tag: 1.2.11
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8787== Changelog ==
    8888
     89= 1.2.11 =
     90*Fixed a PHP deprecation issue.
     91
    8992= 1.2.10 =
    9093* 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.