Plugin Directory

Changeset 3337745


Ignore:
Timestamp:
08/01/2025 10:49:51 AM (4 months ago)
Author:
navzme
Message:

[Fixed] array_keys() expects array, null issue in PHP 8.x

Location:
acf-galerie-4/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • acf-galerie-4/trunk/acf-galerie-4.php

    r3244757 r3337745  
    99 * License: GPL v2 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    11  * Version: 1.4.1
     11 * Version: 1.4.2
    1212 * Domain Path: /lang
    1313 * Requires PHP: 7.4
     
    2424
    2525        public function initialize() {
    26             $this->define( 'ACFG4_VERSION', '1.4.1' );
     26            $this->define( 'ACFG4_VERSION', '1.4.2' );
    2727            $this->define( 'ACFG4_PLUGIN', __FILE__ );
    2828            $this->define( 'ACFG4_PLUGIN_BASENAME', plugin_basename( ACFG4_PLUGIN ) );
  • acf-galerie-4/trunk/providers/class.register-field-type.php

    r3244757 r3337745  
    131131    public function render_field( $field ) {
    132132        $attachments = array();
    133         if ( !empty( $field ) and !empty( $field['value'] ) ) {
     133        if ( !empty( $field ) && !empty( $field['value'] ) && is_array( $field['value'] ) ) {
    134134            $attachment_ids = array_map( 'intval', $field['value'] );
    135135            $attachments = $this->transform( $attachment_ids );
     
    204204     */
    205205    function update_value( $value, $post_id, $field ) {     
    206         if ( empty( $value ) ) {
    207             return array();
    208         }
     206        if( empty( $value ) || !is_array( $value )) return array();
    209207
    210208        return array_map( 'intval', $value );
     
    227225     */
    228226    function format_value( $value, $post_id, $field ) {
    229         if( empty( $value ) ) return array();
     227        if( empty( $value ) || !is_array( $value )) return array();
    230228
    231229        $attachment_ids = array_map( 'intval', $value );
  • acf-galerie-4/trunk/readme.txt

    r3244757 r3337745  
    44Tags: acf, gallery, images, videos, media
    55Requires at least: 5.8
    6 Tested up to: 6.7
    7 Stable tag: 1.4.1
     6Tested up to: 6.8
     7Stable tag: 1.4.2
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    4646
    4747== Changelog ==
     48= 1.4.2 =
     49* [Fixed] array_keys() expects array, null issue in PHP 8.x
     50
    4851= 1.4.1 =
    4952* [Added] Support for ACF Group and Repeater fields.
Note: See TracChangeset for help on using the changeset viewer.