Advanced Custom Fields: Table Field - Version 1.2.7

Version Description

  • Adds PHP constant ACF_TABLEFIELD_FILTER_POSTMETA. Setting this constant to false prevents an update_post_metadata filter looking for tablefield JSON strings destroyed by update_post_meta().

=

Download this release

Release Info

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

Code changes from version 1.3.1-beta3 to 1.2.7

acf-table-v4.php CHANGED
@@ -25,7 +25,6 @@
25
  $this->category = __( 'Layout', 'acf' ); // Basic, Content, Choice, etc
26
  $this->defaults = array(
27
  'use_header' => 0,
28
- 'use_caption' => 2,
29
  // add default here to merge into your field.
30
  // This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg:
31
  //'preview_size' => 'thumbnail'
@@ -37,31 +36,37 @@
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 {
44
 
45
- add_filter( 'update_post_metadata', function( $x, $object_id, $meta_key, $meta_value, $prev_value ) {
 
 
 
 
 
46
 
47
- // detecting ACF table json
48
- if (
49
- is_string( $meta_value ) and
50
- strpos( $meta_value, '"acftf":{' ) !== false
51
- ) {
52
 
53
- // is new value a valid json string
54
- json_decode( $meta_value );
55
 
56
- if ( json_last_error() !== JSON_ERROR_NONE ) {
57
 
58
- // canceling meta value uptdate
59
- error_log( 'The plugin advanced-custom-fields-table-field prevented a third party update_post_meta( ' . $object_id . ', "' . $meta_key . '", $value ); action that would save a broken JSON string.' . "\n" . 'For details see https://codex.wordpress.org/Function_Reference/update_post_meta#Character_Escaping.' );
60
- return true;
 
61
  }
62
- }
63
 
64
- }, 10, 5 );
 
65
 
66
  // }
67
 
@@ -83,42 +88,25 @@
83
  {
84
 
85
  $data_field['use_header'] = $field['use_header'];
86
- $data_field['use_caption'] = $field['use_caption'];
87
 
88
  $e = '';
89
 
90
  $e .= '<div class="acf-table-root">';
91
 
92
- $e .= '<div class="acf-table-optionwrap">';
93
-
94
- // OPTION HEADER {
95
-
96
- if ( $data_field['use_header'] === 0 ) {
97
 
98
- $e .= '<div class="acf-table-optionbox">';
99
- $e .= '<label>' . __( 'use table header', 'acf-table' ) . ' </label>';
100
- $e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" name="acf-table-opt-use-header">';
101
- $e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
102
- $e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
103
- $e .= '</select>';
104
- $e .= '</div>';
105
- }
106
-
107
- // }
108
-
109
- // OPTION CAPTION {
110
-
111
- if ( $data_field['use_caption'] === 1 ) {
112
-
113
- $e .= '<div class="acf-table-optionbox">';
114
- $e .= '<label for="acf-table-opt-caption">' . __( 'table caption', 'acf-table' ) . ' </label><br>';
115
- $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>';
116
- $e .= '</div>';
117
- }
118
 
119
- // }
 
 
 
 
 
 
 
120
 
121
- $e .= '</div>';
122
 
123
  $e .= '<div class="acf-input-wrap">';
124
  $e .= '<input type="hidden" data-field-options="' . urlencode( wp_json_encode( $data_field ) ) . '" id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . urlencode( $field['value'] ) . '"/>';
@@ -184,19 +172,14 @@
184
  $field['use_header'] = 0;
185
  }
186
 
187
- if ( empty( $field['use_caption'] ) ) {
188
-
189
- $field['use_caption'] = 2;
190
- }
191
-
192
  // Create Field Options HTML
193
 
194
- // USE HEADER
195
 
196
  echo '<tr class="field_option field_option_' . $this->name . '">';
197
  echo '<td class="label">';
198
  echo '<label>' . __( "Table Header", 'acf-table' ) . '</label>';
199
- echo '<p class="description">' . __( "Presetting the usage of table header", 'acf-table' ) . '</p>';
200
  echo '</td>';
201
  echo '<td>';
202
 
@@ -210,31 +193,6 @@
210
  2 => __( "No", 'acf-table' ),
211
  ),
212
  'layout' => 'horizontal',
213
- 'default_value' => 0,
214
- ));
215
-
216
- echo '</td>';
217
- echo '</tr>';
218
-
219
- // USER CAPTION
220
-
221
- echo '<tr class="field_option field_option_' . $this->name . '">';
222
- echo '<td class="label">';
223
- echo '<label>' . __( "Table Caption", 'acf-table' ) . '</label>';
224
- echo '<p class="description">' . __( "Presetting the usage of table caption", 'acf-table' ) . '</p>';
225
- echo '</td>';
226
- echo '<td>';
227
-
228
- do_action('acf/create_field', array(
229
- 'type' => 'radio',
230
- 'name' => 'fields[' . $key . '][use_caption]',
231
- 'value' => $field['use_caption'],
232
- 'choices' => array(
233
- 1 => __( "Yes", 'acf-table' ),
234
- 2 => __( "No", 'acf-table' ),
235
- ),
236
- 'layout' => 'horizontal',
237
- 'default_value' => 2,
238
  ));
239
 
240
  echo '</td>';
@@ -282,20 +240,6 @@
282
  $value['header'] = false;
283
  }
284
 
285
- // IF CAPTION DATA
286
-
287
- if (
288
- $field['use_caption'] === 1 AND
289
- ! empty( $a['p']['ca'] )
290
- ) {
291
-
292
- $value['caption'] = $a['p']['ca'];
293
- }
294
- else {
295
-
296
- $value['caption'] = false;
297
- }
298
-
299
  // BODY
300
 
301
  $value['body'] = $a['b'];
@@ -343,11 +287,6 @@
343
  $data = get_post_meta( $post_id, $field['name'], true );
344
  $data = json_decode( $data, true );
345
 
346
- if ( isset( $value['caption'] ) ) {
347
-
348
- $data['p']['ca'] = $value['caption'];
349
- }
350
-
351
  if ( isset( $value['header'] ) ) {
352
 
353
  $data['h'] = $value['header'];
25
  $this->category = __( 'Layout', 'acf' ); // Basic, Content, Choice, etc
26
  $this->defaults = array(
27
  'use_header' => 0,
 
28
  // add default here to merge into your field.
29
  // This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg:
30
  //'preview_size' => 'thumbnail'
36
  // settings
37
  $this->settings = array(
38
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
39
+ 'version' => '1.2.7',
40
  );
41
 
42
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
43
 
44
+ if (
45
+ ! defined( 'ACF_TABLEFIELD_FILTER_POSTMETA' ) OR
46
+ constant( 'ACF_TABLEFIELD_FILTER_POSTMETA' ) === true
47
+ ) {
48
+
49
+ add_filter( 'update_post_metadata', function( $x, $object_id, $meta_key, $meta_value, $prev_value ) {
50
 
51
+ // detecting ACF table json
52
+ if (
53
+ is_string( $meta_value ) and
54
+ strpos( $meta_value, '"acftf":{' ) !== false
55
+ ) {
56
 
57
+ // is new value a valid json string
58
+ json_decode( $meta_value );
59
 
60
+ if ( json_last_error() !== JSON_ERROR_NONE ) {
61
 
62
+ // canceling meta value uptdate
63
+ error_log( 'The plugin advanced-custom-fields-table-field prevented a third party update_post_meta( ' . $object_id . ', "' . $meta_key . '", $value ); action that would save a broken JSON string.' . "\n" . 'For details see https://codex.wordpress.org/Function_Reference/update_post_meta#Character_Escaping.' );
64
+ return true;
65
+ }
66
  }
 
67
 
68
+ }, 10, 5 );
69
+ }
70
 
71
  // }
72
 
88
  {
89
 
90
  $data_field['use_header'] = $field['use_header'];
 
91
 
92
  $e = '';
93
 
94
  $e .= '<div class="acf-table-root">';
95
 
96
+ // OPTION HEADER {
 
 
 
 
97
 
98
+ if ( $data_field['use_header'] === 0 ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
+ $e .= '<div class="acf-table-optionbox">';
101
+ $e .= '<label>' . __( 'use table header', 'acf-table' ) . ' </label>';
102
+ $e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" name="acf-table-opt-use-header">';
103
+ $e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
104
+ $e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
105
+ $e .= '</select>';
106
+ $e .= '</div>';
107
+ }
108
 
109
+ // }
110
 
111
  $e .= '<div class="acf-input-wrap">';
112
  $e .= '<input type="hidden" data-field-options="' . urlencode( wp_json_encode( $data_field ) ) . '" id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . urlencode( $field['value'] ) . '"/>';
172
  $field['use_header'] = 0;
173
  }
174
 
 
 
 
 
 
175
  // Create Field Options HTML
176
 
177
+ // USER HEADER
178
 
179
  echo '<tr class="field_option field_option_' . $this->name . '">';
180
  echo '<td class="label">';
181
  echo '<label>' . __( "Table Header", 'acf-table' ) . '</label>';
182
+ //echo '<p class="description">' . __( "", 'acf' ) . '</p>';
183
  echo '</td>';
184
  echo '<td>';
185
 
193
  2 => __( "No", 'acf-table' ),
194
  ),
195
  'layout' => 'horizontal',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  ));
197
 
198
  echo '</td>';
240
  $value['header'] = false;
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  // BODY
244
 
245
  $value['body'] = $a['b'];
287
  $data = get_post_meta( $post_id, $field['name'], true );
288
  $data = json_decode( $data, true );
289
 
 
 
 
 
 
290
  if ( isset( $value['header'] ) ) {
291
 
292
  $data['h'] = $value['header'];
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.2',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
@@ -57,7 +57,7 @@ class acf_field_table extends acf_field {
57
  */
58
 
59
  $this->l10n = array(
60
- //'error' => __('Error! Please enter a higher value.', 'acf-table'),
61
  );
62
 
63
  // do not delete!
@@ -65,26 +65,32 @@ class acf_field_table extends acf_field {
65
 
66
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
67
 
68
- add_filter( 'update_post_metadata', function( $x, $object_id, $meta_key, $meta_value, $prev_value ) {
 
 
 
 
 
69
 
70
- // detecting ACF table json
71
- if (
72
- is_string( $meta_value ) and
73
- strpos( $meta_value, '"acftf":{' ) !== false
74
- ) {
75
 
76
- // is new value a valid json string
77
- json_decode( $meta_value );
78
 
79
- if ( json_last_error() !== JSON_ERROR_NONE ) {
80
 
81
- // canceling meta value uptdate
82
- error_log( 'The plugin advanced-custom-fields-table-field prevented a third party update_post_meta( ' . $object_id . ', "' . $meta_key . '", $value ); action that would save a broken JSON string.' . "\n" . 'For details see https://codex.wordpress.org/Function_Reference/update_post_meta#Character_Escaping.' );
83
- return true;
 
84
  }
85
- }
86
 
87
- }, 10, 5 );
 
88
 
89
  // }
90
 
@@ -120,26 +126,12 @@ class acf_field_table extends acf_field {
120
  'instructions' => __('Presetting the usage of table header','acf-table'),
121
  'type' => 'radio',
122
  'name' => 'use_header',
123
- 'choices' => array(
124
  0 => __( "Optional", 'acf-table' ),
125
  1 => __( "Yes", 'acf-table' ),
126
  2 => __( "No", 'acf-table' ),
127
  ),
128
- 'layout' => 'horizontal',
129
- 'default_value' => 0,
130
- ));
131
-
132
- acf_render_field_setting( $field, array(
133
- 'label' => __('Table Caption','acf-table'),
134
- 'instructions' => __('Presetting the usage of table caption','acf-table'),
135
- 'type' => 'radio',
136
- 'name' => 'use_caption',
137
- 'choices' => array(
138
- 1 => __( "Yes", 'acf-table' ),
139
- 2 => __( "No", 'acf-table' ),
140
- ),
141
- 'layout' => 'horizontal',
142
- 'default_value' => 2,
143
  ));
144
 
145
  }
@@ -171,56 +163,29 @@ class acf_field_table extends acf_field {
171
  $field['use_header'] = 0;
172
  }
173
 
174
- if ( empty( $field['use_caption'] ) ) {
175
-
176
- $field['use_caption'] = 0;
177
- }
178
-
179
  $data_field['use_header'] = $field['use_header'];
180
- $data_field['use_caption'] = $field['use_caption'];
181
 
182
  $e = '';
183
 
184
  $e .= '<div class="acf-table-root">';
185
 
186
- $e .= '<div class="acf-table-optionwrap">';
187
-
188
- // OPTION HEADER {
189
-
190
- if ( $data_field['use_header'] === 0 ) {
191
-
192
- $e .= '<div class="acf-table-optionbox">';
193
- $e .= '<label for="acf-table-opt-use-header">' . __( 'use table header', 'acf-table' ) . ' </label>';
194
- $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">';
195
- $e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
196
- $e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
197
- $e .= '</select>';
198
- $e .= '</div>';
199
- }
200
-
201
- // }
202
-
203
- // OPTION CAPTION {
204
-
205
- if ( $data_field['use_caption'] === 1 ) {
206
-
207
- $e .= '<div class="acf-table-optionbox">';
208
- $e .= '<label for="acf-table-opt-caption">' . __( 'table caption', 'acf-table' ) . ' </label><br>';
209
- $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>';
210
- $e .= '</div>';
211
- }
212
-
213
- // }
214
 
215
- $e .= '</div>';
216
 
217
- if ( substr( $field['value'] , 0 , 1 ) === '{' ) {
 
 
 
 
 
 
 
218
 
219
- $field['value'] = urlencode( $field['value'] );
220
- }
221
 
222
  $e .= '<div class="acf-input-wrap">';
223
- $e .= '<input type="hidden" data-field-options="' . urlencode( wp_json_encode( $data_field ) ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . esc_attr( $field['type'] ) . '" name="' . esc_attr( $field['name'] ) . '" value="' . $field['value'] . '"/>';
224
  $e .= '</div>';
225
 
226
  $e .= '</div>';
@@ -411,8 +376,7 @@ class acf_field_table extends acf_field {
411
 
412
  if ( is_string( $value ) ) {
413
 
414
- $value = str_replace( '%5C', '%5C%5C', $value );
415
- $value = urldecode( $value );
416
  }
417
 
418
  if ( is_array( $value ) ) {
@@ -420,11 +384,6 @@ class acf_field_table extends acf_field {
420
  $data = get_post_meta( $post_id, $field['name'], true );
421
  $data = json_decode( $data, true );
422
 
423
- if ( isset( $value['caption'] ) ) {
424
-
425
- $data['p']['ca'] = $value['caption'];
426
- }
427
-
428
  if ( isset( $value['header'] ) ) {
429
 
430
  $data['h'] = $value['header'];
@@ -459,15 +418,6 @@ class acf_field_table extends acf_field {
459
 
460
  function format_value( $value, $post_id, $field ) {
461
 
462
- // CHECK FOR GUTENBERG BLOCK CONTENT (URL ENCODED JSON) {
463
-
464
- if ( substr( $value , 0 , 1 ) === '%' ) {
465
-
466
- $value = urldecode( $value );
467
- }
468
-
469
- // }
470
-
471
  $a = json_decode( $value, true );
472
 
473
  $value = false;
@@ -490,20 +440,6 @@ class acf_field_table extends acf_field {
490
  $value['header'] = false;
491
  }
492
 
493
- // IF CAPTION DATA
494
-
495
- if (
496
- $field['use_caption'] === 1 AND
497
- ! empty( $a['p']['ca'] )
498
- ) {
499
-
500
- $value['caption'] = $a['p']['ca'];
501
- }
502
- else {
503
-
504
- $value['caption'] = false;
505
- }
506
-
507
  // BODY
508
 
509
  $value['body'] = $a['b'];
21
  * settings (array) Array of settings
22
  */
23
  $this->settings = array(
24
+ 'version' => '1.2.7',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
57
  */
58
 
59
  $this->l10n = array(
60
+ 'error' => __('Error! Please enter a higher value', 'acf-table'),
61
  );
62
 
63
  // do not delete!
65
 
66
  // PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
67
 
68
+ if (
69
+ ! defined( 'ACF_TABLEFIELD_FILTER_POSTMETA' ) OR
70
+ constant( 'ACF_TABLEFIELD_FILTER_POSTMETA' ) === true
71
+ ) {
72
+
73
+ add_filter( 'update_post_metadata', function( $x, $object_id, $meta_key, $meta_value, $prev_value ) {
74
 
75
+ // detecting ACF table json
76
+ if (
77
+ is_string( $meta_value ) and
78
+ strpos( $meta_value, '"acftf":{' ) !== false
79
+ ) {
80
 
81
+ // is new value a valid json string
82
+ json_decode( $meta_value );
83
 
84
+ if ( json_last_error() !== JSON_ERROR_NONE ) {
85
 
86
+ // canceling meta value uptdate
87
+ error_log( 'The plugin advanced-custom-fields-table-field prevented a third party update_post_meta( ' . $object_id . ', "' . $meta_key . '", $value ); action that would save a broken JSON string.' . "\n" . 'For details see https://codex.wordpress.org/Function_Reference/update_post_meta#Character_Escaping.' );
88
+ return true;
89
+ }
90
  }
 
91
 
92
+ }, 10, 5 );
93
+ }
94
 
95
  // }
96
 
126
  'instructions' => __('Presetting the usage of table header','acf-table'),
127
  'type' => 'radio',
128
  'name' => 'use_header',
129
+ 'choices' => array(
130
  0 => __( "Optional", 'acf-table' ),
131
  1 => __( "Yes", 'acf-table' ),
132
  2 => __( "No", 'acf-table' ),
133
  ),
134
+ 'layout' => 'horizontal',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  ));
136
 
137
  }
163
  $field['use_header'] = 0;
164
  }
165
 
 
 
 
 
 
166
  $data_field['use_header'] = $field['use_header'];
 
167
 
168
  $e = '';
169
 
170
  $e .= '<div class="acf-table-root">';
171
 
172
+ // OPTION HEADER {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
+ if ( $data_field['use_header'] === 0 ) {
175
 
176
+ $e .= '<div class="acf-table-optionbox">';
177
+ $e .= '<label>' . __( 'use table header', 'acf-table' ) . ' </label>';
178
+ $e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" name="acf-table-opt-use-header">';
179
+ $e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
180
+ $e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
181
+ $e .= '</select>';
182
+ $e .= '</div>';
183
+ }
184
 
185
+ // }
 
186
 
187
  $e .= '<div class="acf-input-wrap">';
188
+ $e .= '<input type="hidden" data-field-options="' . urlencode( wp_json_encode( $data_field ) ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . esc_attr( $field['type'] ) . '" name="' . esc_attr( $field['name'] ) . '" value="' . urlencode( $field['value'] ) . '"/>';
189
  $e .= '</div>';
190
 
191
  $e .= '</div>';
376
 
377
  if ( is_string( $value ) ) {
378
 
379
+ $value = urldecode( str_replace( '%5C', '%5C%5C', $value ) );
 
380
  }
381
 
382
  if ( is_array( $value ) ) {
384
  $data = get_post_meta( $post_id, $field['name'], true );
385
  $data = json_decode( $data, true );
386
 
 
 
 
 
 
387
  if ( isset( $value['header'] ) ) {
388
 
389
  $data['h'] = $value['header'];
418
 
419
  function format_value( $value, $post_id, $field ) {
420
 
 
 
 
 
 
 
 
 
 
421
  $a = json_decode( $value, true );
422
 
423
  $value = false;
440
  $value['header'] = false;
441
  }
442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  // BODY
444
 
445
  $value['body'] = $a['b'];
acf-table.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
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
2
  /*
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.2.7
7
  Author: Johann Heyne
8
  Author URI: http://www.johannheyne.de/
9
  License: GPLv2 or later
changelog.txt DELETED
@@ -1,113 +0,0 @@
1
- == Changelog ==
2
-
3
- = 1.3.2 =
4
- * Adds support for ACF Gutenberg blocks
5
-
6
- = 1.3.0 =
7
- * Adds support for table caption
8
- * Fixes a javascript issue for ACF version 4
9
-
10
- = 1.2.6 =
11
- * Replaces jQuery.noConflict methode
12
- * Prevents PHP error if table fields value is from a previous fieldtype
13
-
14
- = 1.2.5 =
15
- * Adds danish translation, thanks to Jeppe Skovsgaard
16
-
17
- = 1.2.4 =
18
- * Fixes backslashes on using update_field();
19
-
20
- = 1.2.3 =
21
- * Adds support for the ACF update_field() function. If you get the table fields data array by get_field(), you can change the table data array and using update_field() to save the changes to the field.
22
-
23
- = 1.2.2 =
24
- * Adds plugin version to table data for handling structural changes.
25
- * Fixes loosing table data containing quotes on third party update_post_meta() actions to table field values. Limited to new fields or fields value changed since plugin version 1.2.2.
26
- * Fixes an PHP warning since PHP 7.2 when body data is null
27
-
28
- = 1.2.1 =
29
- * Fixes not using user locale for translation
30
- * Adds description for handling line breaks to plugins page
31
-
32
- = 1.2 =
33
- * Adds support for tab navigation. Uses shift + tab for backward navigation.
34
- * Minor code improvements
35
-
36
- = 1.1.16 =
37
- * Keeps the WordPress admin area working, if tablefields value is not a valid JSON string. Logs the invalid value in the console for debugging.
38
-
39
- = 1.1.15 =
40
- * Adds polish translation by Pawel Golka
41
-
42
- = 1.1.14 =
43
- * Fixes table does not appear under certain field groups location rules
44
-
45
- = 1.1.13 =
46
- * Fixes an XSS issue within /wp-admin/ pages
47
-
48
- = 1.1.12 =
49
- * Adds support for field groups post taxonomy rule
50
-
51
- = 1.1.11 =
52
- * Fixes rerendering of tables while changing other content
53
-
54
- = 1.1.10 =
55
- * Fixed table functionality with respect to the ACF rules
56
-
57
- = 1.1.9 =
58
- * Fixes returning false on single empty table cell for ACF version 4
59
-
60
- = 1.1.8 =
61
- * Fixes support for user edit pages
62
-
63
- = 1.1.7 =
64
- * Fixes support for user profile pages
65
-
66
- = 1.1.6 =
67
- * UI: Fixes table header switch off problem
68
-
69
- = 1.1.5 =
70
- * Fixes issue occured after database migration with plugin "WP Migrate DB"
71
-
72
- = 1.1.4 =
73
- * Takes over icon class changes in ACF-Pro since version 5.3.2
74
-
75
- = 1.1.3 =
76
- * Fixes wrong function name 'change_template'
77
-
78
- = 1.1.2 =
79
- * Fixes missing table on page template change
80
-
81
- = 1.1.1 =
82
- * Compatibility to icon changes of ACF Pro version 5.2.8
83
- * Fixes table top legend height in FireFox
84
- * Fixes delete column icon position in IE
85
-
86
- = 1.1 =
87
- * Improved User Experience when deleting all columns and rows.
88
- * Compatibility to changes of ACF Pro version 5.2.7.
89
-
90
- = 1.0.7 =
91
- * Use wp_json_encode() instead of json_encode(). This may fix issues in rare enviroments.
92
-
93
- = 1.0.6 =
94
- * If the table has only a single empty cell (this is by default), no table data will return now.
95
-
96
- = 1.0.5 =
97
- * Fixes javascript issue in IE 8.
98
- * Fixes missing table borders and table header´s height in FireFox.
99
-
100
- = 1.0.4 =
101
- * Fixes an uri problem on some hosts.
102
-
103
- = 1.0.3 =
104
- * Fixes an php error on HTTP_REFFERER.
105
-
106
- = 1.0.2 =
107
- * Fixes error when including the plugin from inside a theme.
108
-
109
- = 1.0.1 =
110
- * Fixes ACF validation error "required" when header option "use table header" was used and unchecked.
111
-
112
- = 1.0 =
113
- * Official Release of the free version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/input.css CHANGED
@@ -23,7 +23,7 @@
23
  .acf-table-body-row {
24
  width: 100%;
25
  }
26
-
27
  .acf-table-table * {
28
  background-clip: padding-box; /* fix FireFox and IE background color painting over the borders */
29
  }
@@ -294,7 +294,7 @@
294
  line-height: 1.4;
295
  min-width: 180px;
296
  min-height: 61px !important;
297
-
298
  /* fix profile.php ACF v4 */
299
  width: auto !important;
300
  margin-bottom: 0 !important;
@@ -304,37 +304,19 @@
304
 
305
  /* OPTIONBOX { */
306
 
307
- .acf-table-optionwrap {
308
- margin-top: 16px;
309
- margin-bottom: 16px;
310
- padding: 0 51px 0 45px;
311
- }
312
  .acf-table-optionbox {
313
- margin-top: 16px;
314
- margin-bottom: 16px;
315
  }
316
- .acf-table-optionbox + .acf-table-optionbox {
317
- margin-top: -20px;
 
 
318
  }
319
-
320
- /* FIELDS { */
321
-
322
- .acf-table-optionbox label {
323
- display: inline-block;
324
- font-weight: bold;
325
- padding-right: 6px;
326
- padding-bottom: 10px;
327
- padding-top: 10px;
328
- }
329
-
330
- .acf-table-fc-opt-use-header{
331
- width: auto !important;
332
- }
333
-
334
- .acf-table-fc-opt-caption {
335
- width: 100% !important;
336
- }
337
-
338
- /* FIELDS } */
339
 
340
  /* OPTIONBOX } */
23
  .acf-table-body-row {
24
  width: 100%;
25
  }
26
+
27
  .acf-table-table * {
28
  background-clip: padding-box; /* fix FireFox and IE background color painting over the borders */
29
  }
294
  line-height: 1.4;
295
  min-width: 180px;
296
  min-height: 61px !important;
297
+
298
  /* fix profile.php ACF v4 */
299
  width: auto !important;
300
  margin-bottom: 0 !important;
304
 
305
  /* OPTIONBOX { */
306
 
 
 
 
 
 
307
  .acf-table-optionbox {
308
+ padding-bottom: 8px;
309
+ margin-bottom: 8px;
310
  }
311
+ .acf-flexible-content .acf-table-optionbox {
312
+ border-bottom: 1px solid #e1e1e1;
313
+ padding-bottom: 10px;
314
+ margin-bottom: 10px;
315
  }
316
+
317
+ .acf-table-optionbox-field {
318
+ width: auto !important;
319
+ }
320
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
 
322
  /* OPTIONBOX } */
js/input-v4.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.3.2';
8
 
9
  t.param = {};
10
 
@@ -96,8 +96,7 @@
96
 
97
  t.state = {
98
  'current_cell_obj': false,
99
- 'cell_editor_cell': false,
100
- 'cell_editor_last_keycode': false
101
  };
102
 
103
  t.init = function() {
@@ -118,7 +117,6 @@
118
  t.sortable_row();
119
  t.sortable_col();
120
  t.ui_event_use_header();
121
- t.ui_event_caption();
122
  t.ui_event_new_flex_field();
123
  t.ui_event_change_location_rule();
124
  t.ui_event_ajax();
@@ -241,29 +239,6 @@
241
  // }
242
  };
243
 
244
- t.ui_event_caption = function() {
245
-
246
- // CAPTION: INPUT FIELD ACTIONS {
247
-
248
- t.obj.body.on( 'change', '.acf-table-fc-opt-caption', function() {
249
-
250
- var that = $( this ),
251
- p = {};
252
-
253
- p.obj_root = that.parents( '.acf-table-root' );
254
- p.obj_table = p.obj_root.find( '.acf-table-table' );
255
-
256
- t.data_get( p );
257
- t.data_default( p );
258
-
259
- p.data.p.ca = that.val();
260
- t.update_table_data_field( p );
261
-
262
- } );
263
-
264
- // }
265
- };
266
-
267
  t.ui_event_new_flex_field = function() {
268
 
269
  t.obj.body.on( 'click', '.acf-fc-popup', function() {
@@ -326,9 +301,8 @@
326
 
327
  p: {
328
  o: {
329
- uh: 0, // use header
330
  },
331
- ca: '', // caption content
332
  },
333
 
334
  // from data-colparam
@@ -476,12 +450,6 @@
476
 
477
  t.misc_render = function( p ) {
478
 
479
- t.init_option_use_header( p );
480
- t.init_option_caption( p );
481
- };
482
-
483
- t.init_option_use_header = function( p ) {
484
-
485
  // VARS {
486
 
487
  var v = {};
@@ -544,33 +512,6 @@
544
  // }
545
 
546
  // }
547
-
548
- };
549
-
550
- t.init_option_caption = function( p ) {
551
-
552
- if (
553
- typeof p.field_options.use_caption !== 'number' ||
554
- p.field_options.use_caption === 2
555
- ) {
556
-
557
- return;
558
- }
559
-
560
- // VARS {
561
-
562
- var v = {};
563
-
564
- v.obj_caption = p.obj_root.find( '.acf-table-fc-opt-caption' );
565
-
566
- // }
567
-
568
- // SET CAPTION VALUE {
569
-
570
- v.obj_caption.val( p.data.p.ca );
571
-
572
- // }
573
-
574
  };
575
 
576
  t.table_add_col_event = function() {
4
 
5
  var t = this;
6
 
7
+ t.version = '1.2.7';
8
 
9
  t.param = {};
10
 
96
 
97
  t.state = {
98
  'current_cell_obj': false,
99
+ 'cell_editor_cell': false
 
100
  };
101
 
102
  t.init = function() {
117
  t.sortable_row();
118
  t.sortable_col();
119
  t.ui_event_use_header();
 
120
  t.ui_event_new_flex_field();
121
  t.ui_event_change_location_rule();
122
  t.ui_event_ajax();
239
  // }
240
  };
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  t.ui_event_new_flex_field = function() {
243
 
244
  t.obj.body.on( 'click', '.acf-fc-popup', function() {
301
 
302
  p: {
303
  o: {
304
+ uh: 0,
305
  },
 
306
  },
307
 
308
  // from data-colparam
450
 
451
  t.misc_render = function( p ) {
452
 
 
 
 
 
 
 
453
  // VARS {
454
 
455
  var v = {};
512
  // }
513
 
514
  // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  };
516
 
517
  t.table_add_col_event = function() {
js/input-v5.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.3.2';
8
 
9
  t.param = {};
10
 
@@ -118,7 +118,6 @@
118
  t.sortable_row();
119
  t.sortable_col();
120
  t.ui_event_use_header();
121
- t.ui_event_caption();
122
  t.ui_event_new_flex_field();
123
  t.ui_event_change_location_rule();
124
  t.ui_event_ajax();
@@ -241,29 +240,6 @@
241
  // }
242
  };
243
 
244
- t.ui_event_caption = function() {
245
-
246
- // CAPTION: INPUT FIELD ACTIONS {
247
-
248
- t.obj.body.on( 'change', '.acf-table-fc-opt-caption', function() {
249
-
250
- var that = $( this ),
251
- p = {};
252
-
253
- p.obj_root = that.parents( '.acf-table-root' );
254
- p.obj_table = p.obj_root.find( '.acf-table-table' );
255
-
256
- t.data_get( p );
257
- t.data_default( p );
258
-
259
- p.data.p.ca = that.val();
260
- t.update_table_data_field( p );
261
-
262
- } );
263
-
264
- // }
265
- };
266
-
267
  t.ui_event_new_flex_field = function() {
268
 
269
  t.obj.body.on( 'click', '.acf-fc-popup', function() {
@@ -293,49 +269,19 @@
293
 
294
  p.data = false;
295
 
296
- // CHECK FIELD CONTEXT {
297
-
298
- if ( p.obj_root.closest( '.acf-fields' ).hasClass( 'acf-block-fields' ) ) {
299
-
300
- p.field_context = 'block';
301
- }
302
- else {
303
-
304
- p.field_context = 'box';
305
- }
306
-
307
- // }
308
-
309
  if ( val !== '' ) {
310
 
311
  try {
312
 
313
- if ( p.field_context === 'box' ) {
314
-
315
- p.data = $.parseJSON( decodeURIComponent( val.replace(/\+/g, '%20') ) );
316
- }
317
-
318
- if ( p.field_context === 'block' ) {
319
-
320
- p.data = $.parseJSON( decodeURIComponent( decodeURIComponent( val.replace(/\+/g, '%20') ) ) );
321
- }
322
  }
323
  catch (e) {
324
 
325
- if ( p.field_context === 'box' ) {
326
-
327
- console.log( 'The tablefield value is not a valid JSON string:', decodeURIComponent( val.replace(/\+/g, '%20') ) );
328
- console.log( 'The parsing error:', e );
329
- }
330
 
331
- if ( p.field_context === 'block' ) {
332
-
333
- console.log( 'The tablefield value is not a valid JSON string:', decodeURIComponent( decodeURIComponent( val.replace(/\+/g, '%20') ) ) );
334
- console.log( 'The tablefield value is not a valid JSON string:', decodeURIComponent( decodeURIComponent( decodeURIComponent( val.replace(/\+/g, '%20') ) ) ) );
335
- console.log( 'The parsing error:', e );
336
- }
337
  }
338
-
339
  }
340
 
341
  return p.data;
@@ -356,9 +302,8 @@
356
 
357
  p: {
358
  o: {
359
- uh: 0, // use header
360
  },
361
- ca: '', // caption content
362
  },
363
 
364
  // from data-colparam
@@ -506,12 +451,6 @@
506
 
507
  t.misc_render = function( p ) {
508
 
509
- t.init_option_use_header( p );
510
- t.init_option_caption( p );
511
- };
512
-
513
- t.init_option_use_header = function( p ) {
514
-
515
  // VARS {
516
 
517
  var v = {};
@@ -574,33 +513,6 @@
574
  // }
575
 
576
  // }
577
-
578
- };
579
-
580
- t.init_option_caption = function( p ) {
581
-
582
- if (
583
- typeof p.field_options.use_caption !== 'number' ||
584
- p.field_options.use_caption === 2
585
- ) {
586
-
587
- return;
588
- }
589
-
590
- // VARS {
591
-
592
- var v = {};
593
-
594
- v.obj_caption = p.obj_root.find( '.acf-table-fc-opt-caption' );
595
-
596
- // }
597
-
598
- // SET CAPTION VALUE {
599
-
600
- v.obj_caption.val( p.data.p.ca );
601
-
602
- // }
603
-
604
  };
605
 
606
  t.table_add_col_event = function() {
@@ -919,18 +831,7 @@
919
 
920
  p.data = t.update_table_data_version( p.data );
921
 
922
- // makes json string from data object
923
- var data = JSON.stringify( p.data );
924
-
925
- // adds backslash to all \" in JSON string because encodeURIComponent() strippes backslashes
926
- data.replace( /\\"/g, '\\"' );
927
-
928
- // encodes the JSON string to URI component, the format, the JSON string is saved to the database
929
- data = encodeURIComponent( data )
930
-
931
- p.obj_root.find( 'input.table' ).val( data );
932
-
933
- t.field_changed( p );
934
 
935
  // }
936
  };
@@ -1223,14 +1124,6 @@
1223
 
1224
  };
1225
 
1226
- t.field_changed = function( p ) {
1227
-
1228
- if ( p.field_context === 'block' ) {
1229
-
1230
- p.obj_root.change();
1231
- }
1232
- };
1233
-
1234
  t.sort_cols = function( p ) {
1235
 
1236
  p.obj_table.find('.acf-table-header-row').each( function() {
4
 
5
  var t = this;
6
 
7
+ t.version = '1.2.7';
8
 
9
  t.param = {};
10
 
118
  t.sortable_row();
119
  t.sortable_col();
120
  t.ui_event_use_header();
 
121
  t.ui_event_new_flex_field();
122
  t.ui_event_change_location_rule();
123
  t.ui_event_ajax();
240
  // }
241
  };
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  t.ui_event_new_flex_field = function() {
244
 
245
  t.obj.body.on( 'click', '.acf-fc-popup', function() {
269
 
270
  p.data = false;
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  if ( val !== '' ) {
273
 
274
  try {
275
 
276
+ p.data = $.parseJSON( decodeURIComponent( val.replace(/\+/g, '%20') ) );
 
 
 
 
 
 
 
 
277
  }
278
  catch (e) {
279
 
280
+ p.data = false;
 
 
 
 
281
 
282
+ console.log( 'The tablefield value is not a valid JSON string:', decodeURIComponent( val.replace(/\+/g, '%20') ) );
283
+ console.log( 'The parsing error:', e );
 
 
 
 
284
  }
 
285
  }
286
 
287
  return p.data;
302
 
303
  p: {
304
  o: {
305
+ uh: 0,
306
  },
 
307
  },
308
 
309
  // from data-colparam
451
 
452
  t.misc_render = function( p ) {
453
 
 
 
 
 
 
 
454
  // VARS {
455
 
456
  var v = {};
513
  // }
514
 
515
  // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  };
517
 
518
  t.table_add_col_event = function() {
831
 
832
  p.data = t.update_table_data_version( p.data );
833
 
834
+ p.obj_root.find( 'input.table' ).val( encodeURIComponent( JSON.stringify( p.data ).replace( /\\"/g, '\\"' ) ) );
 
 
 
 
 
 
 
 
 
 
 
835
 
836
  // }
837
  };
1124
 
1125
  };
1126
 
 
 
 
 
 
 
 
 
1127
  t.sort_cols = function( p ) {
1128
 
1129
  p.obj_table.find('.acf-table-header-row').each( function() {
lang/acf-table-da_DK.mo CHANGED
Binary file
lang/acf-table-da_DK.po CHANGED
@@ -2,46 +2,28 @@
2
  # This file is distributed under the same license as the Plugins - Advanced Custom Fields: Table Field - Development (trunk) package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Plugins - Advanced Custom Fields: Table Field - "
6
- "Development (trunk)\n"
7
- "POT-Creation-Date: \n"
8
- "PO-Revision-Date: 2018-11-08 20:23+0100\n"
9
- "Last-Translator: Johann Heyne <mail@johannheyne.de>\n"
10
- "Language-Team: \n"
11
- "Language: da_DK\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
- "X-Generator: Poedit 2.1.1\n"
17
-
18
- #: acf-table-v5.php:208
19
- msgid "table caption"
20
- msgstr ""
21
-
22
- #: acf-table-v5.php:134
23
- msgid "Presetting the usage of table caption"
24
- msgstr ""
25
-
26
- #: acf-table-v5.php:133
27
- msgid "Table Caption"
28
- msgstr ""
29
 
30
  #. Author of the plugin/theme
31
  msgid "Johann Heyne"
32
  msgstr "Johann Heyne"
33
 
34
  #. Description of the plugin/theme
35
- msgid ""
36
- "This free Add-on adds a table field type for the Advanced Custom Fields "
37
- "plugin."
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/"
@@ -54,6 +36,10 @@ msgstr "Advanced Custom Fields: Table Field"
54
  msgid "Presetting the usage of table header"
55
  msgstr "Forudindstilling af brugen af tabeloverskrifter"
56
 
 
 
 
 
57
  #: acf-table-v4.php:185 acf-table-v5.php:124
58
  msgid "Optional"
59
  msgstr "Valgfri"
@@ -63,32 +49,23 @@ msgid "Table Header"
63
  msgstr "Tabeloverskrift"
64
 
65
  #: acf-table-v4.php:98 acf-table-v4.php:186 acf-table-v5.php:125
66
- #: acf-table-v5.php:138 acf-table-v5.php:196
67
  msgid "Yes"
68
  msgstr "Ja"
69
 
70
  #: acf-table-v4.php:97 acf-table-v4.php:187 acf-table-v5.php:126
71
- #: acf-table-v5.php:139 acf-table-v5.php:195
72
  msgid "No"
73
  msgstr "Nej"
74
 
75
- #: acf-table-v4.php:95 acf-table-v5.php:193
76
  msgid "use table header"
77
  msgstr "brug tabeloverskrift"
78
 
 
 
 
 
79
  #: acf-table-v4.php:24 acf-table-v5.php:38
80
  msgid "Table"
81
- msgstr "Tabel"
82
-
83
- #~ msgid ""
84
- #~ "This free Add-on adds a table field type for the Advanced Custom Fields "
85
- #~ "plugin"
86
- #~ msgstr ""
87
- #~ "Dette gratis addon tilføjer et tabel felt til Advanced Custom Fields "
88
- #~ "plugin"
89
-
90
- #~ msgid "Error! Please enter a higher value"
91
- #~ msgstr "Fejl! Indtast venligst en højere værdi"
92
-
93
- #~ msgid "Layout"
94
- #~ msgstr "Layout"
2
  # This file is distributed under the same license as the Plugins - Advanced Custom Fields: Table Field - Development (trunk) package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2018-09-24 10:30:18+0000\n"
 
 
 
 
 
 
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
10
+ "X-Generator: GlotPress/2.4.0-alpha\n"
11
+ "Language: da_DK\n"
12
+ "Project-Id-Version: Plugins - Advanced Custom Fields: Table Field - Development (trunk)\n"
 
 
 
 
 
 
 
 
 
 
13
 
14
  #. Author of the plugin/theme
15
  msgid "Johann Heyne"
16
  msgstr "Johann Heyne"
17
 
18
  #. Description of the plugin/theme
19
+ msgid "This free Add-on adds a table field type for the Advanced Custom Fields plugin"
20
+ msgstr "Dette gratis addon tilføjer et tabel felt til Advanced Custom Fields plugin"
 
 
21
 
22
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
23
+ #. Fields: Table Field 1.2.4) #-#-#-#-#
24
  #. Plugin URI of the plugin/theme
25
  #. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
26
+ #. Fields: Table Field 1.2.4) #-#-#-#-#
27
  #. Author URI of the plugin/theme
28
  msgid "http://www.johannheyne.de/"
29
  msgstr "http://www.johannheyne.de/"
36
  msgid "Presetting the usage of table header"
37
  msgstr "Forudindstilling af brugen af tabeloverskrifter"
38
 
39
+ #: acf-table-v5.php:60
40
+ msgid "Error! Please enter a higher value"
41
+ msgstr "Fejl! Indtast venligst en højere værdi"
42
+
43
  #: acf-table-v4.php:185 acf-table-v5.php:124
44
  msgid "Optional"
45
  msgstr "Valgfri"
49
  msgstr "Tabeloverskrift"
50
 
51
  #: acf-table-v4.php:98 acf-table-v4.php:186 acf-table-v5.php:125
52
+ #: acf-table-v5.php:182
53
  msgid "Yes"
54
  msgstr "Ja"
55
 
56
  #: acf-table-v4.php:97 acf-table-v4.php:187 acf-table-v5.php:126
57
+ #: acf-table-v5.php:181
58
  msgid "No"
59
  msgstr "Nej"
60
 
61
+ #: acf-table-v4.php:95 acf-table-v5.php:179
62
  msgid "use table header"
63
  msgstr "brug tabeloverskrift"
64
 
65
+ #: acf-table-v4.php:25
66
+ msgid "Layout"
67
+ msgstr "Layout"
68
+
69
  #: acf-table-v4.php:24 acf-table-v5.php:38
70
  msgid "Table"
71
+ msgstr "Tabel"
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/acf-table-de_DE.mo CHANGED
Binary file
lang/acf-table-de_DE.po CHANGED
@@ -9,86 +9,30 @@ msgstr ""
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 2.1.1\n"
13
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
 
16
- #: acf-table-v5.php:208
17
- msgid "table caption"
18
- msgstr "Tabellen Beschriftung"
19
-
20
- #: acf-table-v5.php:134
21
- msgid "Presetting the usage of table caption"
22
- msgstr "Voreinstellung für die Verwendung der Tabellen Beschriftung (Caption)"
23
-
24
- #: acf-table-v5.php:133
25
- msgid "Table Caption"
26
- msgstr "Tabellen Beschriftung"
27
-
28
- #. Author of the plugin/theme
29
- msgid "Johann Heyne"
30
- msgstr "Johann Heyne"
31
-
32
- #. Description of the plugin/theme
33
- msgid ""
34
- "This free Add-on adds a table field type for the Advanced Custom Fields "
35
- "plugin."
36
- msgstr ""
37
- "Diese freie Erweiterung fügt dem \"Advanced Custom Fields\" Plugin ein "
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/"
48
-
49
- #. Plugin Name of the plugin/theme
50
- msgid "Advanced Custom Fields: Table Field"
51
- msgstr "Advanced Custom Fields: Table Field"
52
 
53
- #: acf-table-v5.php:120
54
- msgid "Presetting the usage of table header"
55
- msgstr "Voreinstellung für die Verwendung des Tabellenkopfes"
56
 
57
- #: acf-table-v4.php:185 acf-table-v5.php:124
58
  msgid "Optional"
59
  msgstr "Optional"
60
 
61
- #: acf-table-v4.php:175 acf-table-v5.php:119
62
- msgid "Table Header"
63
- msgstr "Tabellenkopf"
64
-
65
- #: acf-table-v4.php:98 acf-table-v4.php:186 acf-table-v5.php:125
66
- #: acf-table-v5.php:138 acf-table-v5.php:196
67
  msgid "Yes"
68
  msgstr "Ja"
69
 
70
- #: acf-table-v4.php:97 acf-table-v4.php:187 acf-table-v5.php:126
71
- #: acf-table-v5.php:139 acf-table-v5.php:195
72
  msgid "No"
73
  msgstr "Nein"
74
 
75
- #: acf-table-v4.php:95 acf-table-v5.php:193
76
- msgid "use table header"
77
- msgstr "verwende Tabellenkopf"
78
-
79
- #: acf-table-v4.php:24 acf-table-v5.php:38
80
  msgid "Table"
81
  msgstr "Tabelle"
82
-
83
- #~ msgid "Error! Please enter a higher value."
84
- #~ msgstr "Fehler! Bitte gib einen höheren Wert ein."
85
-
86
- #~ msgid "Error! Please enter a higher value"
87
- #~ msgstr "Fehler! Bitte gib einen höheren Wert ein."
88
-
89
- #~ msgid ""
90
- #~ "This free Add-on adds a table field type for the Advanced Custom Fields "
91
- #~ "plugin"
92
- #~ msgstr ""
93
- #~ "Diese freie Erweiterung fügt dem \"Advanced Custom Fields\" Plugin ein "
94
- #~ "Tabellen Feldtype hinzu."
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.4\n"
13
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
 
16
+ #: acf-table.php:71
17
+ msgid "use table header"
18
+ msgstr "verwende Tabellenkopf"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ #: acf-table.php:148
21
+ msgid "Table Header"
22
+ msgstr "Tabellenkopf"
23
 
24
+ #: acf-table.php:158
25
  msgid "Optional"
26
  msgstr "Optional"
27
 
28
+ #: acf-table.php:159
 
 
 
 
 
29
  msgid "Yes"
30
  msgstr "Ja"
31
 
32
+ #: acf-table.php:160
 
33
  msgid "No"
34
  msgstr "Nein"
35
 
36
+ #: acf-table.php:21
 
 
 
 
37
  msgid "Table"
38
  msgstr "Tabelle"
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/acf-table-pl_PL.mo CHANGED
Binary file
lang/acf-table-pl_PL.po CHANGED
@@ -9,71 +9,30 @@ msgstr ""
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 2.1.1\n"
13
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
 
16
- #: acf-table-v5.php:208
17
- msgid "table caption"
18
- msgstr ""
19
-
20
- #: acf-table-v5.php:134
21
- msgid "Presetting the usage of table caption"
22
- msgstr ""
23
-
24
- #: acf-table-v5.php:133
25
- msgid "Table Caption"
26
- msgstr ""
27
-
28
- #. Author of the plugin/theme
29
- msgid "Johann Heyne"
30
- msgstr ""
31
-
32
- #. Description of the plugin/theme
33
- msgid ""
34
- "This free Add-on adds a table field type for the Advanced Custom Fields "
35
- "plugin."
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 ""
46
-
47
- #. Plugin Name of the plugin/theme
48
- msgid "Advanced Custom Fields: Table Field"
49
- msgstr ""
50
 
51
- #: acf-table-v5.php:120
52
- msgid "Presetting the usage of table header"
53
- msgstr ""
54
 
55
- #: acf-table-v4.php:185 acf-table-v5.php:124
56
  msgid "Optional"
57
  msgstr "Opcjonalne"
58
 
59
- #: acf-table-v4.php:175 acf-table-v5.php:119
60
- msgid "Table Header"
61
- msgstr "Nagłówek tabeli"
62
-
63
- #: acf-table-v4.php:98 acf-table-v4.php:186 acf-table-v5.php:125
64
- #: acf-table-v5.php:138 acf-table-v5.php:196
65
  msgid "Yes"
66
  msgstr "Tak"
67
 
68
- #: acf-table-v4.php:97 acf-table-v4.php:187 acf-table-v5.php:126
69
- #: acf-table-v5.php:139 acf-table-v5.php:195
70
  msgid "No"
71
  msgstr "Nie"
72
 
73
- #: acf-table-v4.php:95 acf-table-v5.php:193
74
- msgid "use table header"
75
- msgstr "Użyj nagłówka tabeli"
76
-
77
- #: acf-table-v4.php:24 acf-table-v5.php:38
78
  msgid "Table"
79
  msgstr "Tabela"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.9\n"
13
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
 
16
+ #: acf-table.php:71
17
+ msgid "use table header"
18
+ msgstr "Użyj nagłówka tabeli"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ #: acf-table.php:148
21
+ msgid "Table Header"
22
+ msgstr "Nagłówek tabeli"
23
 
24
+ #: acf-table.php:158
25
  msgid "Optional"
26
  msgstr "Opcjonalne"
27
 
28
+ #: acf-table.php:159
 
 
 
 
 
29
  msgid "Yes"
30
  msgstr "Tak"
31
 
32
+ #: acf-table.php:160
 
33
  msgid "No"
34
  msgstr "Nie"
35
 
36
+ #: acf-table.php:21
 
 
 
 
37
  msgid "Table"
38
  msgstr "Tabela"
lang/acf-table.pot CHANGED
@@ -1,75 +1,37 @@
1
- # Translation of Plugins - Advanced Custom Fields: Table Field - Development (trunk) in German
2
- # This file is distributed under the same license as the Plugins - Advanced Custom Fields: Table Field - Development (trunk) package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: +0000\n"
 
 
 
 
6
  "MIME-Version: 1.0\n"
7
- "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
10
- "X-Generator: GlotPress/2.4.0-alpha\n"
11
- "Language: de\n"
12
- "Project-Id-Version: Plugins - Advanced Custom Fields: Table Field - Development (trunk)\n"
13
 
14
- #: acf-table-v5.php:208
15
- msgid "table caption"
16
- msgstr ""
17
-
18
- #: acf-table-v5.php:134
19
- msgid "Presetting the usage of table caption"
20
- msgstr ""
21
-
22
- #: acf-table-v5.php:133
23
- msgid "Table Caption"
24
- msgstr ""
25
-
26
- #. Author of the plugin/theme
27
- msgid "Johann Heyne"
28
- msgstr ""
29
-
30
- #. Description of the plugin/theme
31
- msgid "This free Add-on adds a table field type for the Advanced Custom Fields plugin."
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 ""
42
-
43
- #. Plugin Name of the plugin/theme
44
- msgid "Advanced Custom Fields: Table Field"
45
  msgstr ""
46
 
47
- #: acf-table-v5.php:120
48
- msgid "Presetting the usage of table header"
49
  msgstr ""
50
 
51
- #: acf-table-v4.php:185 acf-table-v5.php:124
52
  msgid "Optional"
53
  msgstr ""
54
 
55
- #: acf-table-v4.php:175 acf-table-v5.php:119
56
- msgid "Table Header"
57
- msgstr ""
58
-
59
- #: acf-table-v4.php:98 acf-table-v4.php:186 acf-table-v5.php:125
60
- #: acf-table-v5.php:138 acf-table-v5.php:196
61
  msgid "Yes"
62
  msgstr ""
63
 
64
- #: acf-table-v4.php:97 acf-table-v4.php:187 acf-table-v5.php:126
65
- #: acf-table-v5.php:139 acf-table-v5.php:195
66
  msgid "No"
67
  msgstr ""
68
 
69
- #: acf-table-v4.php:95 acf-table-v5.php:193
70
- msgid "use table header"
71
- msgstr ""
72
-
73
- #: acf-table-v4.php:24 acf-table-v5.php:38
74
  msgid "Table"
75
- msgstr ""
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: ACF Table Field\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: \n"
6
+ "Last-Translator: Johann Heyne <mail@johannheyne.de>\n"
7
+ "Language-Team: Johann Heyne <mail@johannheyne.de>\n"
8
  "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=iso-8859-1\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.6.4\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
 
14
 
15
+ #: acf-table.php:71
16
+ msgid "use table header"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  msgstr ""
18
 
19
+ #: acf-table.php:148
20
+ msgid "Table Header"
21
  msgstr ""
22
 
23
+ #: acf-table.php:158
24
  msgid "Optional"
25
  msgstr ""
26
 
27
+ #: acf-table.php:159
 
 
 
 
 
28
  msgid "Yes"
29
  msgstr ""
30
 
31
+ #: acf-table.php:160
 
32
  msgid "No"
33
  msgstr ""
34
 
35
+ #: acf-table.php:21
 
 
 
 
36
  msgid "Table"
37
+ msgstr ""
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Advanced Custom Fields: Table Field ===
2
  Contributors: jonua
3
  Tags: acf table
4
- Requires at least: 5.0.3
5
- Tested up to: 5.1
6
- Stable tag: 1.2.6
7
- Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
10
  A Table Field Add-on for the Advanced Custom Fields Plugin.
@@ -17,10 +17,12 @@ This plugin requires the ["Advanced Custom Fields" plugin](https://de.wordpress.
17
 
18
  The table field works also with the repeater and flexible field types.
19
 
 
 
 
 
20
  = Features =
21
  * Table Header (Option)
22
- * Table Caption (Option)
23
- * Support for ACF Gutenberg blocks
24
  * Add and remove table columns and rows
25
  * Change order of columns and rows by dragging
26
  * To move to the next cells editor press key: tab
@@ -35,15 +37,10 @@ To render the table fields data as an html table in one of your template files (
35
  `
36
  $table = get_field( 'your_table_field_name' );
37
 
38
- if ( ! empty ( $table ) ) {
39
 
40
  echo '<table border="0">';
41
 
42
- if ( ! empty( $table['caption'] ) ) {
43
-
44
- echo '<caption>' . $table['caption'] . '</caption>';
45
- }
46
-
47
  if ( ! empty( $table['header'] ) ) {
48
 
49
  echo '<thead>';
@@ -168,11 +165,6 @@ For now the way to go is using the Elementors shortcode Widget. Before you can u
168
 
169
  $return .= '<table border="0">';
170
 
171
- if ( ! empty( $table['caption'] ) ) {
172
-
173
- echo '<caption>' . $table['caption'] . '</caption>';
174
- }
175
-
176
  if ( $table['header'] ) {
177
 
178
  $return .= '<thead>';
@@ -230,6 +222,18 @@ Or you can **insert a table from a ACF option page**…
230
 
231
  `[table field-name="your table field name" post-id="option"]`
232
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  == Installation ==
234
 
235
  This software can be used as both a WP plugin and a theme include.
@@ -261,25 +265,13 @@ However, only when activated as a plugin will updates be available.
261
 
262
  == Upgrade Notice ==
263
 
264
- = 1.3.2 =
265
- * Adds support for ACF Gutenberg blocks
266
-
267
- = 1.3.0 =
268
- * Adds support for table caption
269
- * Still supports version 4 of ACF
270
-
271
- = 1.2.6 =
272
- Fixes an PHP error and improves JavaScript code.
273
-
274
 
275
  == Changelog ==
276
 
277
- = 1.3.2 =
278
- * Adds support for ACF Gutenberg blocks
279
-
280
- = 1.3.0 =
281
- * Adds support for table caption
282
- * Fixes a javascript issue for ACF version 4
283
 
284
  = 1.2.6 =
285
  * Replaces jQuery.noConflict methode
1
  === Advanced Custom Fields: Table Field ===
2
  Contributors: jonua
3
  Tags: acf table
4
+ Requires at least: 4.9
5
+ Tested up to: 5.0.3
6
+ Stable tag: 1.2.7
7
+ Requires PHP: 7.0.0
8
  License: GPLv2 or later
9
 
10
  A Table Field Add-on for the Advanced Custom Fields Plugin.
17
 
18
  The table field works also with the repeater and flexible field types.
19
 
20
+ = ACF Pro 5.8 will introduce Blocks for Gutenberg =
21
+
22
+ 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 Table Field version [1.3.1-beta3](https://downloads.wordpress.org/plugin/advanced-custom-fields-table-field.1.3.1-beta3.zip) together with the latest ACF Pro 4.8 Beta available on your ACF account. Click the ***See all versions*** link alongside your license.
23
+
24
  = Features =
25
  * Table Header (Option)
 
 
26
  * Add and remove table columns and rows
27
  * Change order of columns and rows by dragging
28
  * To move to the next cells editor press key: tab
37
  `
38
  $table = get_field( 'your_table_field_name' );
39
 
40
+ if ( ! empty( $table ) ) {
41
 
42
  echo '<table border="0">';
43
 
 
 
 
 
 
44
  if ( ! empty( $table['header'] ) ) {
45
 
46
  echo '<thead>';
165
 
166
  $return .= '<table border="0">';
167
 
 
 
 
 
 
168
  if ( $table['header'] ) {
169
 
170
  $return .= '<thead>';
222
 
223
  `[table field-name="your table field name" post-id="option"]`
224
 
225
+ = Third party plugins issues =
226
+
227
+ The table field stores the table data as a JSON string in postmeta. This can lead to situations where the table plugin prevents third party plugins to update, copy or otherwise storing the tables data.
228
+
229
+ Third party plugins may using update_post_metadata() on table fields data wich removes backslashes by default. Without applying wp_slash() to the value before update_post_metadata(), the JSON string of the table data would break because backslashes are part of the JSON data syntax escaping quotation marks in content.
230
+
231
+ To prevent that issue, the table field plugin checks on every update_post_metadata() if the content value is from a table field and still is a valid JSON string. If not, update_post_metadata() will fail and throw an error message, that explains the issue.
232
+
233
+ In same cases, the table JSON string is just part of serialized data by a third party plugin. The JSON string check of the table field plugin prevents storing that data as well even though the data JSON string may is correct. You could disable the check using the following code in the wp-config.php file. But then the table data are no longe protected from destroing by update_post_metadata(). Use the following code only, if you understand the risk…
234
+
235
+ `define( "ACF_TABLEFIELD_FILTER_POSTMETA", false );`
236
+
237
  == Installation ==
238
 
239
  This software can be used as both a WP plugin and a theme include.
265
 
266
  == Upgrade Notice ==
267
 
268
+ = 1.2.7 =
269
+ * Adds PHP constant ACF_TABLEFIELD_FILTER_POSTMETA. Setting this constant to false prevents an update_post_metadata filter looking for tablefield JSON strings destroyed by update_post_meta().
 
 
 
 
 
 
 
 
270
 
271
  == Changelog ==
272
 
273
+ = 1.2.7 =
274
+ * Adds PHP constant ACF_TABLEFIELD_FILTER_POSTMETA. Setting this constant to false prevents an update_post_metadata filter looking for tablefield JSON strings destroyed by update_post_meta().
 
 
 
 
275
 
276
  = 1.2.6 =
277
  * Replaces jQuery.noConflict methode