Plugin Directory

Changeset 3046138


Ignore:
Timestamp:
03/06/2024 07:55:23 AM (2 years ago)
Author:
podpirate
Message:

Release 3.3.4

Location:
acf-quickedit-fields
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • acf-quickedit-fields/tags/3.3.4/include/ACFQuickEdit/Admin/Admin.php

    r3044352 r3046138  
    156156        add_action( 'load-users.php', [ $this, 'enqueue_columns_assets' ] );
    157157        add_action( 'acf/field_group/admin_enqueue_scripts', [ $this, 'enqueue_fieldgroup_assets' ] );
    158 
    159     }
    160 
    161     public function is_field_group_saving() {
    162         return isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] )
    163             && isset( $_POST['action'] ) && isset( $_POST['_acf_screen'] )
    164             && 'POST' === $_SERVER['REQUEST_METHOD']
    165             && 'editpost' === wp_unslash( $_POST['action'] )
    166             && 'field_group' === wp_unslash( $_POST['_acf_screen'] );
    167158    }
    168159
  • acf-quickedit-fields/tags/3.3.4/include/ACFQuickEdit/Admin/Feature.php

    r3044352 r3046138  
    4141        $this->admin = Admin::instance();
    4242
     43
    4344        if ( wp_doing_ajax() ) {
    44             add_action( 'admin_init', [ $this, 'init_fields' ] );
    45         } else if ( ! $this->admin->is_field_group_saving() )  {
    46             add_action( 'current_screen', [ $this, 'init_fields' ] );
     45            $actions = array_merge(
     46                apply_filters( 'acf_quick_edit_post_ajax_actions', [ 'inline-save' ] ),
     47                apply_filters( 'acf_quick_edit_term_ajax_actions', [ 'inline-save-tax' ] ),
     48                [ 'get_acf_post_meta' ]
     49            );
     50            if ( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $actions ) ) {
     51                add_action( 'admin_init', [ $this, 'init_fields' ] );
     52            }
     53        } else {
     54            add_action( 'current_screen', [ $this, 'current_screen' ] );
    4755        }
    4856
     
    5260    }
    5361
     62    /**
     63     *  @filter current_screen
     64     */
     65    public function current_screen( $current_screen ) {
     66        global $pagenow;
     67        if (
     68            in_array( $pagenow, [ 'edit.php', 'edit-tags.php', 'users.php', 'upload.php' ] )
     69            && 'acf-field-group' !== $current_screen->post_type
     70        ) {
     71            $this->init_fields();
     72        }
     73    }
    5474
    5575    /**
  • acf-quickedit-fields/tags/3.3.4/include/ACFQuickEdit/Fields/DateTimePickerField.php

    r2907571 r3046138  
    1313    protected function _render_column( $object_id ) {
    1414
    15         $value = $this->get_value( $object_id, false );
     15        $value = (string) $this->get_value( $object_id, false );
    1616
    17         if ( is_null( $value ) ) {
     17        if ( '' === $value ) {
    1818            return $this->__no_value();
    1919        }
  • acf-quickedit-fields/tags/3.3.4/include/ACFQuickEdit/Fields/Traits/InputRadio.php

    r3044352 r3046138  
    2929
    3030        if ( $acf_field['allow_null'] ) {
     31            $id = $this->core->prefix( $acf_field['key'] . '---none' );
    3132            $output .= sprintf( '<li><label for="%s">', $id );
    3233            $output .= sprintf( '<input %s />%s', acf_esc_attr( [
     
    4546        foreach( $acf_field['choices'] as $name => $value) {
    4647
    47             $id = $this->core->prefix( $acf_field['key'] . '-' . $name );
     48            $id = $this->core->prefix( $acf_field['key'] . '-' . sanitize_key( $name ) );
    4849
    4950            $output .= sprintf( '<li><label for="%s">', $id );
  • acf-quickedit-fields/tags/3.3.4/include/version.php

    r3044352 r3046138  
    1 <?php return "3.3.3";
     1<?php return "3.3.4";
  • acf-quickedit-fields/tags/3.3.4/index.php

    r3044352 r3046138  
    66Description: Show Advanced Custom Fields in post list table. Edit field values in Quick Edit and / or Bulk edit.
    77Author: Jörn Lund
    8 Version: 3.3.3
     8Version: 3.3.4
    99Author URI: https://github.com/mcguffin
    1010License: GPL3
  • acf-quickedit-fields/tags/3.3.4/languages/acf-quickedit-fields.pot

    r3044352 r3046138  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ACF QuickEdit Fields 3.3.3\n"
     5"Project-Id-Version: ACF QuickEdit Fields 3.3.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/acf-quickedit-fields\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-03-03T10:11:05+00:00\n"
     12"POT-Creation-Date: 2024-03-06T07:54:58+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    4141
    4242#. Translators: 1: ACF Pro URL, 2: plugins page url
    43 #: include/ACFQuickEdit/Admin/Admin.php:255
     43#: include/ACFQuickEdit/Admin/Admin.php:246
    4444msgid "The <strong>ACF QuickEdit Fields</strong> plugin requires <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">ACF version 5.6 or later</a>. You can disable and uninstall it on the <a href=\"%2$s\">plugins page</a>."
    4545msgstr ""
     
    189189
    190190#: include/ACFQuickEdit/Fields/Field.php:492
    191 #: include/ACFQuickEdit/Fields/Traits/InputRadio.php:40
     191#: include/ACFQuickEdit/Fields/Traits/InputRadio.php:41
    192192#: include/ACFQuickEdit/Fields/TrueFalseField.php:38
    193193msgid "(No value)"
  • acf-quickedit-fields/tags/3.3.4/readme.txt

    r3044352 r3046138  
    66Tested up to: 6.3
    77Requires PHP: 7.2
    8 Stable tag: 3.3.3
     8Stable tag: 3.3.4
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    105105
    106106== Changelog ==
     107
     108= 3.3.4 =
     109 - Performance: Skip feature init on edit post
     110 - Fix: PHP warning, None label not clickable in radio fields
     111 - Fix: show no value in datetime fields
    107112
    108113= 3.3.3 =
  • acf-quickedit-fields/trunk/include/ACFQuickEdit/Admin/Admin.php

    r3044352 r3046138  
    156156        add_action( 'load-users.php', [ $this, 'enqueue_columns_assets' ] );
    157157        add_action( 'acf/field_group/admin_enqueue_scripts', [ $this, 'enqueue_fieldgroup_assets' ] );
    158 
    159     }
    160 
    161     public function is_field_group_saving() {
    162         return isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] )
    163             && isset( $_POST['action'] ) && isset( $_POST['_acf_screen'] )
    164             && 'POST' === $_SERVER['REQUEST_METHOD']
    165             && 'editpost' === wp_unslash( $_POST['action'] )
    166             && 'field_group' === wp_unslash( $_POST['_acf_screen'] );
    167158    }
    168159
  • acf-quickedit-fields/trunk/include/ACFQuickEdit/Admin/Feature.php

    r3044352 r3046138  
    4141        $this->admin = Admin::instance();
    4242
     43
    4344        if ( wp_doing_ajax() ) {
    44             add_action( 'admin_init', [ $this, 'init_fields' ] );
    45         } else if ( ! $this->admin->is_field_group_saving() )  {
    46             add_action( 'current_screen', [ $this, 'init_fields' ] );
     45            $actions = array_merge(
     46                apply_filters( 'acf_quick_edit_post_ajax_actions', [ 'inline-save' ] ),
     47                apply_filters( 'acf_quick_edit_term_ajax_actions', [ 'inline-save-tax' ] ),
     48                [ 'get_acf_post_meta' ]
     49            );
     50            if ( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $actions ) ) {
     51                add_action( 'admin_init', [ $this, 'init_fields' ] );
     52            }
     53        } else {
     54            add_action( 'current_screen', [ $this, 'current_screen' ] );
    4755        }
    4856
     
    5260    }
    5361
     62    /**
     63     *  @filter current_screen
     64     */
     65    public function current_screen( $current_screen ) {
     66        global $pagenow;
     67        if (
     68            in_array( $pagenow, [ 'edit.php', 'edit-tags.php', 'users.php', 'upload.php' ] )
     69            && 'acf-field-group' !== $current_screen->post_type
     70        ) {
     71            $this->init_fields();
     72        }
     73    }
    5474
    5575    /**
  • acf-quickedit-fields/trunk/include/ACFQuickEdit/Fields/DateTimePickerField.php

    r2907571 r3046138  
    1313    protected function _render_column( $object_id ) {
    1414
    15         $value = $this->get_value( $object_id, false );
     15        $value = (string) $this->get_value( $object_id, false );
    1616
    17         if ( is_null( $value ) ) {
     17        if ( '' === $value ) {
    1818            return $this->__no_value();
    1919        }
  • acf-quickedit-fields/trunk/include/ACFQuickEdit/Fields/Traits/InputRadio.php

    r3044352 r3046138  
    2929
    3030        if ( $acf_field['allow_null'] ) {
     31            $id = $this->core->prefix( $acf_field['key'] . '---none' );
    3132            $output .= sprintf( '<li><label for="%s">', $id );
    3233            $output .= sprintf( '<input %s />%s', acf_esc_attr( [
     
    4546        foreach( $acf_field['choices'] as $name => $value) {
    4647
    47             $id = $this->core->prefix( $acf_field['key'] . '-' . $name );
     48            $id = $this->core->prefix( $acf_field['key'] . '-' . sanitize_key( $name ) );
    4849
    4950            $output .= sprintf( '<li><label for="%s">', $id );
  • acf-quickedit-fields/trunk/include/version.php

    r3044352 r3046138  
    1 <?php return "3.3.3";
     1<?php return "3.3.4";
  • acf-quickedit-fields/trunk/index.php

    r3044352 r3046138  
    66Description: Show Advanced Custom Fields in post list table. Edit field values in Quick Edit and / or Bulk edit.
    77Author: Jörn Lund
    8 Version: 3.3.3
     8Version: 3.3.4
    99Author URI: https://github.com/mcguffin
    1010License: GPL3
  • acf-quickedit-fields/trunk/languages/acf-quickedit-fields.pot

    r3044352 r3046138  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ACF QuickEdit Fields 3.3.3\n"
     5"Project-Id-Version: ACF QuickEdit Fields 3.3.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/acf-quickedit-fields\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-03-03T10:11:05+00:00\n"
     12"POT-Creation-Date: 2024-03-06T07:54:58+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    4141
    4242#. Translators: 1: ACF Pro URL, 2: plugins page url
    43 #: include/ACFQuickEdit/Admin/Admin.php:255
     43#: include/ACFQuickEdit/Admin/Admin.php:246
    4444msgid "The <strong>ACF QuickEdit Fields</strong> plugin requires <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">ACF version 5.6 or later</a>. You can disable and uninstall it on the <a href=\"%2$s\">plugins page</a>."
    4545msgstr ""
     
    189189
    190190#: include/ACFQuickEdit/Fields/Field.php:492
    191 #: include/ACFQuickEdit/Fields/Traits/InputRadio.php:40
     191#: include/ACFQuickEdit/Fields/Traits/InputRadio.php:41
    192192#: include/ACFQuickEdit/Fields/TrueFalseField.php:38
    193193msgid "(No value)"
  • acf-quickedit-fields/trunk/readme.txt

    r3044352 r3046138  
    66Tested up to: 6.3
    77Requires PHP: 7.2
    8 Stable tag: 3.3.3
     8Stable tag: 3.3.4
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    105105
    106106== Changelog ==
     107
     108= 3.3.4 =
     109 - Performance: Skip feature init on edit post
     110 - Fix: PHP warning, None label not clickable in radio fields
     111 - Fix: show no value in datetime fields
    107112
    108113= 3.3.3 =
Note: See TracChangeset for help on using the changeset viewer.