Advanced Custom Fields: Table Field - Version 1.3.4

Version Description

Fixes an issue that prevents the removal of table contents.

=

Download this release

Release Info

Developer Jonua
Plugin Icon 128x128 Advanced Custom Fields: Table Field
Version 1.3.4
Comparing to
See all releases

Code changes from version 1.3.3 to 1.3.4

acf-table-v4.php CHANGED
@@ -37,7 +37,7 @@
37
  // settings
38
  $this->settings = array(
39
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
40
- 'version' => '1.3.3',
41
  );
42
 
43
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
@@ -374,32 +374,34 @@
374
  $value = json_decode( $value, true );
375
  }
376
 
377
- if ( is_array( $value ) ) {
378
 
379
- $data = get_post_meta( $post_id, $field['name'], true );
 
 
 
380
 
381
- if ( empty( $data ) ) {
382
 
383
- $data = array();
384
- }
385
 
386
- if ( is_string( $data ) ) {
 
387
 
388
- $data = json_decode( $data, true );
389
- }
390
 
391
- if ( isset( $value['header'] ) ) {
 
392
 
393
- $data['h'] = $value['header'];
394
- }
395
 
396
- if ( isset( $value['body'] ) ) {
 
397
 
398
- $data['b'] = $value['body'];
399
  }
400
 
401
- $value = array_replace_recursive( $data, $value );
402
- }
403
 
404
  $value = $this->table_slash( $value );
405
 
37
  // settings
38
  $this->settings = array(
39
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
40
+ 'version' => '1.3.4',
41
  );
42
 
43
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
374
  $value = json_decode( $value, true );
375
  }
376
 
377
+ // UPDATE via update_field() {
378
 
379
+ if (
380
+ isset( $value['header'] ) OR
381
+ isset( $value['body'] )
382
+ ) {
383
 
384
+ $data = get_post_meta( $post_id, $field['name'], true );
385
 
386
+ if ( is_string( $data ) ) {
 
387
 
388
+ $data = json_decode( $data, true );
389
+ }
390
 
391
+ if ( isset( $value['header'] ) ) {
 
392
 
393
+ $data['h'] = $value['header'];
394
+ }
395
 
396
+ if ( isset( $value['body'] ) ) {
 
397
 
398
+ $data['b'] = $value['body'];
399
+ }
400
 
401
+ $value = $data;
402
  }
403
 
404
+ // }
 
405
 
406
  $value = $this->table_slash( $value );
407
 
acf-table-v5.php CHANGED
@@ -21,7 +21,7 @@ class acf_field_table extends acf_field {
21
  * settings (array) Array of settings
22
  */
23
  $this->settings = array(
24
- 'version' => '1.3.3',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
@@ -430,32 +430,34 @@ class acf_field_table extends acf_field {
430
  $value = json_decode( $value, true );
431
  }
432
 
433
- if ( is_array( $value ) ) {
434
 
435
- $data = get_post_meta( $post_id, $field['name'], true );
 
 
 
436
 
437
- if ( empty( $data ) ) {
438
 
439
- $data = array();
440
- }
441
 
442
- if ( is_string( $data ) ) {
 
443
 
444
- $data = json_decode( $data, true );
445
- }
446
 
447
- if ( isset( $value['header'] ) ) {
 
448
 
449
- $data['h'] = $value['header'];
450
- }
451
 
452
- if ( isset( $value['body'] ) ) {
 
453
 
454
- $data['b'] = $value['body'];
455
  }
456
 
457
- $value = array_replace_recursive( $data, $value );
458
- }
459
 
460
  $value = $this->table_slash( $value );
461
 
21
  * settings (array) Array of settings
22
  */
23
  $this->settings = array(
24
+ 'version' => '1.3.4',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
430
  $value = json_decode( $value, true );
431
  }
432
 
433
+ // UPDATE via update_field() {
434
 
435
+ if (
436
+ isset( $value['header'] ) OR
437
+ isset( $value['body'] )
438
+ ) {
439
 
440
+ $data = get_post_meta( $post_id, $field['name'], true );
441
 
442
+ if ( is_string( $data ) ) {
 
443
 
444
+ $data = json_decode( $data, true );
445
+ }
446
 
447
+ if ( isset( $value['header'] ) ) {
 
448
 
449
+ $data['h'] = $value['header'];
450
+ }
451
 
452
+ if ( isset( $value['body'] ) ) {
 
453
 
454
+ $data['b'] = $value['body'];
455
+ }
456
 
457
+ $value = $data;
458
  }
459
 
460
+ // }
 
461
 
462
  $value = $this->table_slash( $value );
463
 
acf-table.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields: Table Field
4
  Plugin URI: http://www.johannheyne.de/
5
  Description: This free Add-on adds a table field type for the Advanced Custom Fields plugin.
6
- Version: 1.3.3
7
  Author: Johann Heyne
8
  Author URI: http://www.johannheyne.de/
9
  License: GPLv2 or later
3
  Plugin Name: Advanced Custom Fields: Table Field
4
  Plugin URI: http://www.johannheyne.de/
5
  Description: This free Add-on adds a table field type for the Advanced Custom Fields plugin.
6
+ Version: 1.3.4
7
  Author: Johann Heyne
8
  Author URI: http://www.johannheyne.de/
9
  License: GPLv2 or later
changelog.txt CHANGED
@@ -1,13 +1,16 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 1.3.3 =
4
  * Fixes returning empty table after saving content containing a single quote
5
 
6
- = 1.3.3 =
7
  * Fixes returning empty table after saving content containing quotes
8
  * Fixes an issue using update_field() on a table field
9
 
10
- = 1.3.3 =
11
  * Changes table data storing format from JSON string to serialized array. This is due to an issue caused by third party plugins using update_post_meta() without providing wp_slash() to the value before. Existing table data values in JSON string format in the database will still exists and be compatible. When a field is saved again, the storage format changes from JSON to serialized array.
12
  * Fixes an PHP error of table caption
13
 
1
  == Changelog ==
2
 
3
+ = 1.3.4 =
4
+ * Fixes an issue that prevents the removal of table contents
5
+
6
  = 1.3.3 =
7
  * Fixes returning empty table after saving content containing a single quote
8
 
9
+ = 1.3.4 =
10
  * Fixes returning empty table after saving content containing quotes
11
  * Fixes an issue using update_field() on a table field
12
 
13
+ = 1.3.4 =
14
  * Changes table data storing format from JSON string to serialized array. This is due to an issue caused by third party plugins using update_post_meta() without providing wp_slash() to the value before. Existing table data values in JSON string format in the database will still exists and be compatible. When a field is saved again, the storage format changes from JSON to serialized array.
15
  * Fixes an PHP error of table caption
16
 
js/input-v4.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.3.3';
8
 
9
  t.param = {};
10
 
4
 
5
  var t = this;
6
 
7
+ t.version = '1.3.4';
8
 
9
  t.param = {};
10
 
js/input-v5.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.3.3';
8
 
9
  t.param = {};
10
 
4
 
5
  var t = this;
6
 
7
+ t.version = '1.3.4';
8
 
9
  t.param = {};
10
 
lang/acf-table-da_DK.po CHANGED
@@ -38,10 +38,10 @@ msgid ""
38
  msgstr ""
39
 
40
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
41
- #. Fields: Table Field 1.3.3) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
- #. Fields: Table Field 1.3.3) #-#-#-#-#
45
  #. Author URI of the plugin/theme
46
  msgid "http://www.johannheyne.de/"
47
  msgstr "http://www.johannheyne.de/"
38
  msgstr ""
39
 
40
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
41
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
45
  #. Author URI of the plugin/theme
46
  msgid "http://www.johannheyne.de/"
47
  msgstr "http://www.johannheyne.de/"
lang/acf-table-de_DE.po CHANGED
@@ -38,10 +38,10 @@ msgstr ""
38
  "Tabellen Feldtype hinzu."
39
 
40
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
41
- #. Fields: Table Field 1.3.3) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
- #. Fields: Table Field 1.3.3) #-#-#-#-#
45
  #. Author URI of the plugin/theme
46
  msgid "http://www.johannheyne.de/"
47
  msgstr "http://www.johannheyne.de/"
38
  "Tabellen Feldtype hinzu."
39
 
40
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
41
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
45
  #. Author URI of the plugin/theme
46
  msgid "http://www.johannheyne.de/"
47
  msgstr "http://www.johannheyne.de/"
lang/acf-table-pl_PL.po CHANGED
@@ -36,10 +36,10 @@ msgid ""
36
  msgstr ""
37
 
38
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
39
- #. Fields: Table Field 1.3.3) #-#-#-#-#
40
  #. Plugin URI of the plugin/theme
41
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
42
- #. Fields: Table Field 1.3.3) #-#-#-#-#
43
  #. Author URI of the plugin/theme
44
  msgid "http://www.johannheyne.de/"
45
  msgstr ""
36
  msgstr ""
37
 
38
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
39
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
40
  #. Plugin URI of the plugin/theme
41
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
42
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
43
  #. Author URI of the plugin/theme
44
  msgid "http://www.johannheyne.de/"
45
  msgstr ""
lang/acf-table.pot CHANGED
@@ -32,10 +32,10 @@ msgid "This free Add-on adds a table field type for the Advanced Custom Fields p
32
  msgstr ""
33
 
34
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
35
- #. Fields: Table Field 1.3.3) #-#-#-#-#
36
  #. Plugin URI of the plugin/theme
37
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
38
- #. Fields: Table Field 1.3.3) #-#-#-#-#
39
  #. Author URI of the plugin/theme
40
  msgid "http://www.johannheyne.de/"
41
  msgstr ""
32
  msgstr ""
33
 
34
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
35
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
36
  #. Plugin URI of the plugin/theme
37
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
38
+ #. Fields: Table Field 1.3.4) #-#-#-#-#
39
  #. Author URI of the plugin/theme
40
  msgid "http://www.johannheyne.de/"
41
  msgstr ""
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jonua
3
  Tags: acf table
4
  Requires at least: 5.0.3
5
  Tested up to: 5.1
6
- Stable tag: 1.3.3
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
@@ -277,6 +277,7 @@ Since version 1.3.1 of the table plugin, the storing format of the table data ch
277
 
278
  The table field plugin prevents broken JSON strings to save as a table field data and throws an error message that explains the issue. But this may also breaks the functionality of the third party plugin trying to update the table data. You could disable the JSON string check in the table field plugin using the following code in the wp-config.php file. But then the table JSON data are no longer protected from destroing by `update_post_metadata()`. Use the following code in wp-config.php only, if you understand the risk…
279
 
 
280
 
281
  == Installation ==
282
 
@@ -309,19 +310,14 @@ However, only when activated as a plugin will updates be available.
309
 
310
  == Upgrade Notice ==
311
 
312
- = 1.3.3 =
313
- * Fixes returning empty table after saving content containing a single quote.
314
-
315
- = 1.3.2 =
316
- Fixes returning empty table after saving content containing quotes.
317
- Fixes an issue using update_field() on a table field.
318
-
319
- = 1.3.1 =
320
- Changes table data storing format from JSON string to serialized array. This is due to an issue caused by third party plugins using update_post_meta() without providing wp_slash() to the value before. Existing table data values in JSON string format in the database will still exists and be compatible. When a field is saved again, the storage format changes from JSON to serialized array.
321
- Fixes an PHP error of table caption.
322
 
323
  == Changelog ==
324
 
 
 
 
325
  = 1.3.3 =
326
  * Fixes returning empty table after saving content containing a single quote.
327
 
3
  Tags: acf table
4
  Requires at least: 5.0.3
5
  Tested up to: 5.1
6
+ Stable tag: 1.3.4
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
277
 
278
  The table field plugin prevents broken JSON strings to save as a table field data and throws an error message that explains the issue. But this may also breaks the functionality of the third party plugin trying to update the table data. You could disable the JSON string check in the table field plugin using the following code in the wp-config.php file. But then the table JSON data are no longer protected from destroing by `update_post_metadata()`. Use the following code in wp-config.php only, if you understand the risk…
279
 
280
+ `define( "ACF_TABLEFIELD_FILTER_POSTMETA", false );`
281
 
282
  == Installation ==
283
 
310
 
311
  == Upgrade Notice ==
312
 
313
+ = 1.3.4 =
314
+ Fixes an issue that prevents the removal of table contents.
 
 
 
 
 
 
 
 
315
 
316
  == Changelog ==
317
 
318
+ = 1.3.4 =
319
+ * Fixes an issue that prevents the removal of table contents
320
+
321
  = 1.3.3 =
322
  * Fixes returning empty table after saving content containing a single quote.
323