Changeset 3409348
- Timestamp:
- 12/03/2025 11:02:48 AM (4 months ago)
- Location:
- advanced-custom-fields-table-field/trunk
- Files:
-
- 5 added
- 1 deleted
- 4 edited
-
acf-table.php (modified) (2 diffs)
-
changelog.txt (modified) (1 diff)
-
class-jh-acf-field-table.php (modified) (4 diffs)
-
integrations (added)
-
integrations/polylang (added)
-
integrations/polylang/init.php (added)
-
js/execute.js (added)
-
js/init.js (added)
-
js/input.js (deleted)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-custom-fields-table-field/trunk/acf-table.php
r3386339 r3409348 4 4 Plugin URI: https://www.acf-table-field.com 5 5 Description: This free Add-on adds a table field type for the plugins Advanced Custom Fields and Secure Custom Fields. 6 Version: 1.3.3 16 Version: 1.3.32 7 7 Author: Johann Heyne 8 8 Author URI: http://www.johannheyne.de … … 45 45 46 46 require_once __DIR__ . '/class-jh-acf-field-table.php'; 47 require_once __DIR__ . '/integrations/polylang/init.php'; 47 48 48 49 acf_register_field_type( 'jh_acf_field_table' ); -
advanced-custom-fields-table-field/trunk/changelog.txt
r3386339 r3409348 1 1 == 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 2 9 3 10 = 1.3.31 = -
advanced-custom-fields-table-field/trunk/class-jh-acf-field-table.php
r3386339 r3409348 40 40 */ 41 41 $this->settings = array( 42 'version' => '1.3.3 1',42 'version' => '1.3.32', 43 43 'dir_url' => plugins_url( '', __FILE__ ) . '/', 44 44 ); … … 223 223 if ( $data_field['use_header'] === 0 ) { 224 224 225 $id = uniqid(); 226 225 227 $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">'; 228 230 $e .= '<option value="0">' . __( 'No', 'advanced-custom-fields-table-field' ) . '</option>'; 229 231 $e .= '<option value="1">' . __( 'Yes', 'advanced-custom-fields-table-field' ) . '</option>'; … … 238 240 if ( $data_field['use_caption'] === 1 ) { 239 241 242 $id = uniqid(); 243 240 244 $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>'; 243 247 $e .= '</div>'; 244 248 } … … 288 292 289 293 // 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 ); 291 296 292 297 // register & include CSS -
advanced-custom-fields-table-field/trunk/readme.txt
r3386344 r3409348 4 4 Requires at least: 5.3 5 5 Tested up to: 6.8 6 Stable tag: 1.3.3 16 Stable tag: 1.3.32 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 464 464 `define( "ACF_TABLEFIELD_FILTER_POSTMETA", false );` 465 465 466 = UI Sanitizing Options = 467 468 Since version 1.3.32, you can configure the UI sanitizing options. 469 Ensure you create a dedicated admin script for configuring the table field plugin in your theme and enqueue it correctly. 470 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 the functions.php file with the following action. 475 476 ` 477 add_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 488 The sanitization of the table fields UI is handled by DOMPurify. 489 Use 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 466 501 == Installation == 467 502 … … 519 554 == Changelog == 520 555 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 521 563 = 1.3.31 = 522 564 * Adds sanitizing table data using wp_kses( $data, 'post' ) during update_field().
Note: See TracChangeset
for help on using the changeset viewer.