Advanced Custom Fields: Table Field - Version 1.3.2

Version Description

Fixes returning empty table after saving content containing quotes. Fixes an issue using update_field() on a table field.

Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

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.1',
41
  );
42
 
43
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
@@ -369,7 +369,7 @@
369
  {
370
  if ( is_string( $value ) ) {
371
 
372
- $value = str_replace( '%5C', '%5C%5C', $value );
373
  $value = urldecode( $value );
374
  $value = json_decode( $value, true );
375
  }
@@ -388,6 +388,16 @@
388
  $data = json_decode( $data, true );
389
  }
390
 
 
 
 
 
 
 
 
 
 
 
391
  $value = array_replace_recursive( $data, $value );
392
  }
393
 
37
  // settings
38
  $this->settings = array(
39
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
40
+ 'version' => '1.3.2',
41
  );
42
 
43
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
369
  {
370
  if ( is_string( $value ) ) {
371
 
372
+ //$value = str_replace( '%5C', '%5C%5C', $value );
373
  $value = urldecode( $value );
374
  $value = json_decode( $value, true );
375
  }
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
 
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.1',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
@@ -425,7 +425,7 @@ class acf_field_table extends acf_field {
425
 
426
  if ( is_string( $value ) ) {
427
 
428
- $value = str_replace( '%5C', '%5C%5C', $value );
429
  $value = urldecode( $value );
430
  $value = json_decode( $value, true );
431
  }
@@ -444,6 +444,16 @@ class acf_field_table extends acf_field {
444
  $data = json_decode( $data, true );
445
  }
446
 
 
 
 
 
 
 
 
 
 
 
447
  $value = array_replace_recursive( $data, $value );
448
  }
449
 
21
  * settings (array) Array of settings
22
  */
23
  $this->settings = array(
24
+ 'version' => '1.3.2',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
425
 
426
  if ( is_string( $value ) ) {
427
 
428
+ //$value = str_replace( '%5C', '%5C%5C', $value );
429
  $value = urldecode( $value );
430
  $value = json_decode( $value, true );
431
  }
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
 
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.1
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.2
7
  Author: Johann Heyne
8
  Author URI: http://www.johannheyne.de/
9
  License: GPLv2 or later
changelog.txt CHANGED
@@ -1,6 +1,10 @@
1
  == Changelog ==
2
 
3
- = 1.3.1 =
 
 
 
 
4
  * 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.
5
  * Fixes an PHP error of table caption
6
 
1
  == Changelog ==
2
 
3
+ = 1.3.2 =
4
+ * Fixes returning empty table after saving content containing quotes
5
+ * Fixes an issue using update_field() on a table field
6
+
7
+ = 1.3.2 =
8
  * 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.
9
  * Fixes an PHP error of table caption
10
 
js/input-v4.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.3.1';
8
 
9
  t.param = {};
10
 
4
 
5
  var t = this;
6
 
7
+ t.version = '1.3.2';
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.1';
8
 
9
  t.param = {};
10
 
4
 
5
  var t = this;
6
 
7
+ t.version = '1.3.2';
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.1) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
- #. Fields: Table Field 1.3.1) #-#-#-#-#
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.2) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
+ #. Fields: Table Field 1.3.2) #-#-#-#-#
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.1) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
- #. Fields: Table Field 1.3.1) #-#-#-#-#
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.2) #-#-#-#-#
42
  #. Plugin URI of the plugin/theme
43
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
44
+ #. Fields: Table Field 1.3.2) #-#-#-#-#
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.1) #-#-#-#-#
40
  #. Plugin URI of the plugin/theme
41
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
42
- #. Fields: Table Field 1.3.1) #-#-#-#-#
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.2) #-#-#-#-#
40
  #. Plugin URI of the plugin/theme
41
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
42
+ #. Fields: Table Field 1.3.2) #-#-#-#-#
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.1) #-#-#-#-#
36
  #. Plugin URI of the plugin/theme
37
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
38
- #. Fields: Table Field 1.3.1) #-#-#-#-#
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.2) #-#-#-#-#
36
  #. Plugin URI of the plugin/theme
37
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
38
+ #. Fields: Table Field 1.3.2) #-#-#-#-#
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.1
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
@@ -30,7 +30,6 @@ The table field works also with the repeater and flexible field types.
30
 
31
  The Table Field will support the new [ACF Blocks for Gutenberg](https://www.advancedcustomfields.com/blog/acf-5-8-introducing-acf-blocks-for-gutenberg/). You can test it now. Download and install the latest ACF Pro 4.8 Beta available on your ACF account. Click the ***See all versions*** link alongside your license.
32
 
33
-
34
  == Frequently Asked Questions ==
35
 
36
  = How to output the table html? =
@@ -161,6 +160,7 @@ For now the way to go is using the Elementors shortcode Widget. Before you can u
161
  `function shortcode_acf_tablefield( $atts ) {
162
 
163
  $a = shortcode_atts( array(
 
164
  'field-name' => false,
165
  'post-id' => false,
166
  ), $atts );
@@ -171,7 +171,7 @@ For now the way to go is using the Elementors shortcode Widget. Before you can u
171
 
172
  if ( $table ) {
173
 
174
- $return .= '<table border="0">';
175
 
176
  if ( ! empty( $table['caption'] ) ) {
177
 
@@ -225,15 +225,15 @@ add_shortcode( 'table', 'shortcode_acf_tablefield' );`
225
 
226
  Then use the shortcode in a Elementors shortcode widget like this, to **insert a table from the current page or post**…
227
 
228
- `[table field-name="your table field name"]`
229
 
230
  You also can **insert a table from another page or post**…
231
 
232
- `[table field-name="your table field name" post-id="123"]`
233
 
234
  Or you can **insert a table from a ACF option page**…
235
 
236
- `[table field-name="your table field name" post-id="option"]`
237
 
238
  = Third party plugins issues =
239
 
@@ -278,12 +278,20 @@ However, only when activated as a plugin will updates be available.
278
 
279
  == Upgrade Notice ==
280
 
 
 
 
 
281
  = 1.3.1 =
282
- * 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.
283
- * Fixes an PHP error of table caption
284
 
285
  == Changelog ==
286
 
 
 
 
 
287
  = 1.3.1 =
288
  * 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.
289
  * Fixes an PHP error of table caption
3
  Tags: acf table
4
  Requires at least: 5.0.3
5
  Tested up to: 5.1
6
+ Stable tag: 1.3.2
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
30
 
31
  The Table Field will support the new [ACF Blocks for Gutenberg](https://www.advancedcustomfields.com/blog/acf-5-8-introducing-acf-blocks-for-gutenberg/). You can test it now. Download and install the latest ACF Pro 4.8 Beta available on your ACF account. Click the ***See all versions*** link alongside your license.
32
 
 
33
  == Frequently Asked Questions ==
34
 
35
  = How to output the table html? =
160
  `function shortcode_acf_tablefield( $atts ) {
161
 
162
  $a = shortcode_atts( array(
163
+ 'table-class' => '',
164
  'field-name' => false,
165
  'post-id' => false,
166
  ), $atts );
171
 
172
  if ( $table ) {
173
 
174
+ $return .= '<table class="' . $table['table-class'] . '" border="0">';
175
 
176
  if ( ! empty( $table['caption'] ) ) {
177
 
225
 
226
  Then use the shortcode in a Elementors shortcode widget like this, to **insert a table from the current page or post**…
227
 
228
+ `[table field-name="your table field name" table-class="my-table"]`
229
 
230
  You also can **insert a table from another page or post**…
231
 
232
+ `[table field-name="your table field name" post-id="123" table-class="my-table"]`
233
 
234
  Or you can **insert a table from a ACF option page**…
235
 
236
+ `[table field-name="your table field name" post-id="option" table-class="my-table"]`
237
 
238
  = Third party plugins issues =
239
 
278
 
279
  == Upgrade Notice ==
280
 
281
+ = 1.3.2 =
282
+ Fixes returning empty table after saving content containing quotes.
283
+ Fixes an issue using update_field() on a table field.
284
+
285
  = 1.3.1 =
286
+ 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.
287
+ Fixes an PHP error of table caption.
288
 
289
  == Changelog ==
290
 
291
+ = 1.3.2 =
292
+ * Fixes returning empty table after saving content containing quotes
293
+ * Fixes an issue using update_field() on a table field
294
+
295
  = 1.3.1 =
296
  * 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.
297
  * Fixes an PHP error of table caption