Plugin Directory

Changeset 3409348


Ignore:
Timestamp:
12/03/2025 11:02:48 AM (4 months ago)
Author:
Jonua
Message:

Updates trunk and changes stable tag to 1.3.32

Location:
advanced-custom-fields-table-field/trunk
Files:
5 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • advanced-custom-fields-table-field/trunk/acf-table.php

    r3386339 r3409348  
    44Plugin URI: https://www.acf-table-field.com
    55Description: This free Add-on adds a table field type for the plugins Advanced Custom Fields and Secure Custom Fields.
    6 Version: 1.3.31
     6Version: 1.3.32
    77Author: Johann Heyne
    88Author URI: http://www.johannheyne.de
     
    4545
    4646    require_once __DIR__ . '/class-jh-acf-field-table.php';
     47    require_once __DIR__ . '/integrations/polylang/init.php';
    4748
    4849    acf_register_field_type( 'jh_acf_field_table' );
  • advanced-custom-fields-table-field/trunk/changelog.txt

    r3386339 r3409348  
    11== Changelog ==
     2
     3= 1.3.32 =
     4* Adds basic Polylang support
     5* Enables loading and executing a admin script between the plugins init script and execute script to use plugins Javascript hooks
     6* Adds Javascript filter for DOMPurify options
     7* Adds sanitizing for the table caption
     8* Fixes none unique HTML element ids
    29
    310= 1.3.31 =
  • advanced-custom-fields-table-field/trunk/class-jh-acf-field-table.php

    r3386339 r3409348  
    4040        */
    4141        $this->settings = array(
    42             'version' => '1.3.31',
     42            'version' => '1.3.32',
    4343            'dir_url' => plugins_url( '', __FILE__ ) . '/',
    4444        );
     
    223223                    if ( $data_field['use_header'] === 0 ) {
    224224
     225                        $id = uniqid();
     226
    225227                        $e .= '<div class="acf-table-optionbox">';
    226                             $e .= '<label for="acf-table-opt-use-header">' . __( 'use table header', 'advanced-custom-fields-table-field' ) . ' </label>';
    227                             $e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" id="acf-table-opt-use-header" name="acf-table-opt-use-header">';
     228                            $e .= '<label for="acf-table-opt-use-header-' . $id . '">' . __( 'use table header', 'advanced-custom-fields-table-field' ) . ' </label>';
     229                            $e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" id="acf-table-opt-use-header-' . $id . '" name="acf-table-opt-use-header">';
    228230                                $e .= '<option value="0">' . __( 'No', 'advanced-custom-fields-table-field' ) . '</option>';
    229231                                $e .= '<option value="1">' . __( 'Yes', 'advanced-custom-fields-table-field' ) . '</option>';
     
    238240                    if ( $data_field['use_caption'] === 1 ) {
    239241
     242                        $id = uniqid();
     243
    240244                        $e .= '<div class="acf-table-optionbox">';
    241                             $e .= '<label for="acf-table-opt-caption">' . __( 'Table Caption', 'advanced-custom-fields-table-field' ) . ' </label><br>';
    242                             $e .= '<input class="acf-table-optionbox-field acf-table-fc-opt-caption" id="acf-table-opt-caption" type="text" name="acf-table-opt-caption" value=""></input>';
     245                            $e .= '<label for="acf-table-opt-caption-' . $id . '">' . __( 'Table Caption', 'advanced-custom-fields-table-field' ) . ' </label><br>';
     246                            $e .= '<input class="acf-table-optionbox-field acf-table-fc-opt-caption" id="acf-table-opt-caption-' . $id . '" type="text" name="acf-table-opt-caption" value=""></input>';
    243247                        $e .= '</div>';
    244248                    }
     
    288292
    289293        // register & include JS
    290         wp_enqueue_script( 'acf-input-table', $this->settings['dir_url'] . 'js/input.js', array( 'jquery', 'acf-input' ), $this->settings['version'], true );
     294        wp_enqueue_script( 'acf-input-table', $this->settings['dir_url'] . 'js/init.js', array( 'jquery', 'acf-input' ), $this->settings['version'], true );
     295        wp_enqueue_script( 'acf-input-table-execute', $this->settings['dir_url'] . 'js/execute.js', array( 'acf-input-table' ), $this->settings['version'], true );
    291296
    292297        // register & include CSS
  • advanced-custom-fields-table-field/trunk/readme.txt

    r3386344 r3409348  
    44Requires at least: 5.3
    55Tested up to: 6.8
    6 Stable tag: 1.3.31
     6Stable tag: 1.3.32
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    464464`define( "ACF_TABLEFIELD_FILTER_POSTMETA", false );`
    465465
     466= UI Sanitizing Options =
     467
     468Since version 1.3.32, you can configure the UI sanitizing options.
     469Ensure you create a dedicated admin script for configuring the table field plugin in your theme and enqueue it correctly.
     470This is required so that the hook can be registered in the plugin after the plugin initialization and before the plugin script functionalities are executed.
     471
     472Create a file in your theme at the path `/js/table-field-config.js`.
     473
     474Than enqueue that script in the functions.php file with the following action.
     475
     476`
     477add_action( 'admin_enqueue_scripts', function() {
     478
     479    wp_enqueue_script(
     480        'table-field-config', // Table field config script handle
     481        get_template_directory_uri() . '/js/table-field-config.js', // Path to the script in the theme
     482        array('acf-input-table'), // Required, ensures that the script is loaded and executed at the correct time
     483        '1.0', // Version of the script
     484        true // Required to be correctly placed in the script queue
     485    );
     486});`
     487
     488The sanitization of the table fields UI is handled by DOMPurify.
     489Use the following table field hook to modify the DOMPurify options.
     490
     491`ACFTableField.addFilter( 'core', 'sanitize_html', function( options ) {
     492
     493    // DOMPurify Options, @see: https://github.com/cure53/DOMPurify?tab=readme-ov-file#can-i-configure-dompurify
     494
     495    options.ADD_ATTR = ['target']; // For instance, the target attribute can be permitted
     496
     497    return options;
     498});`
     499
     500
    466501== Installation ==
    467502
     
    519554== Changelog ==
    520555
     556= 1.3.32 =
     557* Adds basic Polylang support
     558* Enables loading and executing a admin script between the plugins init script and execute script to use plugins Javascript hooks
     559* Adds Javascript filter for DOMPurify options
     560* Adds sanitizing for the table caption
     561* Fixes none unique HTML element ids
     562
    521563= 1.3.31 =
    522564* Adds sanitizing table data using wp_kses( $data, 'post' ) during update_field().
Note: See TracChangeset for help on using the changeset viewer.