Plugin Directory

Changeset 3414476


Ignore:
Timestamp:
12/08/2025 03:11:46 PM (4 months ago)
Author:
Jonua
Message:
  • Updates plugin and stable version to 1.3.33
  • Adds hook registering event "tableFieldRegisterHooks"
  • Changes example showing how to enqueue an admin script and apply the "sanitize_html" filter.
Location:
advanced-custom-fields-table-field/trunk
Files:
5 edited

Legend:

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

    r3409348 r3414476  
    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.32
     6Version: 1.3.33
    77Author: Johann Heyne
    88Author URI: http://www.johannheyne.de
  • advanced-custom-fields-table-field/trunk/changelog.txt

    r3409348 r3414476  
    11== Changelog ==
     2
     3= 1.3.33 =
     4* Adds hook registering event "tableFieldRegisterHooks"
     5* Changes example showing how to enqueue an admin script and apply the "sanitize_html" filter.
    26
    37= 1.3.32 =
  • advanced-custom-fields-table-field/trunk/class-jh-acf-field-table.php

    r3409348 r3414476  
    4040        */
    4141        $this->settings = array(
    42             'version' => '1.3.32',
     42            'version' => '1.3.33',
    4343            'dir_url' => plugins_url( '', __FILE__ ) . '/',
    4444        );
  • advanced-custom-fields-table-field/trunk/js/init.js

    r3409348 r3414476  
    77        var t = this;
    88
    9         t.version = '1.3.32';
     9        t.version = '1.3.33';
    1010
    1111        t.param = {};
     
    18071807
    18081808    ACFTableField = new ACFTableFieldMain();
     1809    document.dispatchEvent(new CustomEvent('tableFieldRegisterHooks'));
    18091810
    18101811})( jQuery );
  • advanced-custom-fields-table-field/trunk/readme.txt

    r3409368 r3414476  
    44Requires at least: 5.3
    55Tested up to: 6.9
    6 Stable tag: 1.3.32
     6Stable tag: 1.3.33
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    466466= UI Sanitizing Options =
    467467
    468 Since version 1.3.32, you can configure the UI sanitizing options.
    469 
    470 Ensure you create a dedicated admin script for configuring the table field plugin in your theme and enqueue it correctly. This 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 
    472 Create a file in your theme at the path `/js/table-field-config.js`.
    473 
    474 Than enqueue that script in your themes `functions.php` file with the following action.
    475 
    476 `
    477 add_action( 'admin_enqueue_scripts', function() {
     468Since version 1.3.33, you can configure the UI sanitizing options.
     469
     470This requires an admin script, that. You can in your themes `functions.php` file with the following action.
     471
     472`
     473add_action( 'acf/input/admin_enqueue_scripts', function() {
    478474
    479475    wp_enqueue_script(
    480476        'table-field-config', // Table field config script handle
    481477        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
    485478    );
    486479});`
     
    489482Use the following table field hook in your table field config script to modify the DOMPurify options.
    490483
    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 });`
     484`
     485document.addEventListener('tableFieldRegisterHooks', function(){
     486
     487    ACFTableField.addFilter( 'core', 'sanitize_html', function( options ) {
     488
     489        // DOMPurify Options, @see: https://github.com/cure53/DOMPurify?tab=readme-ov-file#can-i-configure-dompurify
     490
     491        options.ADD_ATTR = ['target']; // For instance, the target attribute can be permitted
     492
     493        return options;
     494    });
     495});
     496`
    499497
    500498
     
    554552== Changelog ==
    555553
     554= 1.3.33 =
     555* Adds hook registering event "tableFieldRegisterHooks"
     556* Changes and fixes example showing how to enqueue an admin script and apply the "sanitize_html" filter.
     557
    556558= 1.3.32 =
    557559* Adds basic Polylang support
Note: See TracChangeset for help on using the changeset viewer.