Advanced Custom Fields: Table Field - Version 1.3.1

Version Description

  • 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.
  • Fixes an PHP error of table caption

=

Download this release

Release Info

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

Code changes from version 1.2.7 to 1.3.1

acf-table-v4.php CHANGED
@@ -25,6 +25,7 @@
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,7 +37,7 @@
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 {
@@ -88,28 +89,58 @@
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'] ) . '"/>';
113
  $e .= '</div>';
114
 
115
  $e .= '</div>';
@@ -172,14 +203,19 @@
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,6 +229,31 @@
193
  2 => __( "No", 'acf-table' ),
194
  ),
195
  'layout' => 'horizontal',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  ));
197
 
198
  echo '</td>';
@@ -218,7 +279,21 @@
218
 
219
  function format_value_for_api( $value, $post_id, $field )
220
  {
221
- $a = json_decode( $value, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
 
223
  $value = false;
224
 
@@ -240,6 +315,21 @@
240
  $value['header'] = false;
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  // BODY
244
 
245
  $value['body'] = $a['b'];
@@ -279,25 +369,26 @@
279
  {
280
  if ( is_string( $value ) ) {
281
 
282
- $value = urldecode( str_replace( '%5C', '%5C%5C', $value ) );
 
 
283
  }
284
 
285
  if ( is_array( $value ) ) {
286
 
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'];
293
  }
294
 
295
- if ( isset( $value['body'] ) ) {
296
 
297
- $data['b'] = $value['body'];
298
  }
299
 
300
- $value = wp_slash( json_encode( $data ) );
301
  }
302
 
303
  return $value;
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
  // 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 {
89
  {
90
 
91
  $data_field['use_header'] = $field['use_header'];
92
+ $data_field['use_caption'] = $field['use_caption'];
93
 
94
  $e = '';
95
 
96
  $e .= '<div class="acf-table-root">';
97
 
98
+ $e .= '<div class="acf-table-optionwrap">';
99
 
100
+ // OPTION HEADER {
101
 
102
+ if ( $data_field['use_header'] === 0 ) {
103
+
104
+ $e .= '<div class="acf-table-optionbox">';
105
+ $e .= '<label>' . __( 'use table header', 'acf-table' ) . ' </label>';
106
+ $e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" name="acf-table-opt-use-header">';
107
+ $e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
108
+ $e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
109
+ $e .= '</select>';
110
+ $e .= '</div>';
111
+ }
112
+
113
+ // }
114
+
115
+ // OPTION CAPTION {
116
+
117
+ if ( $data_field['use_caption'] === 1 ) {
118
+
119
+ $e .= '<div class="acf-table-optionbox">';
120
+ $e .= '<label for="acf-table-opt-caption">' . __( 'table caption', 'acf-table' ) . ' </label><br>';
121
+ $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>';
122
+ $e .= '</div>';
123
+ }
124
+
125
+ // }
126
+
127
+ $e .= '</div>';
128
+
129
+ if ( is_array( $field['value'] ) ) {
130
+
131
+ $field['value'] = wp_json_encode( $field['value'] );
132
  }
133
 
134
+ if ( is_string( $field['value'] ) ) {
135
+
136
+ if ( substr( $field['value'] , 0 , 1 ) === '{' ) {
137
+
138
+ $field['value'] = urlencode( $field['value'] );
139
+ }
140
+ }
141
 
142
  $e .= '<div class="acf-input-wrap">';
143
+ $e .= '<input type="hidden" data-field-options="' . urlencode( wp_json_encode( $data_field ) ) . '" id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . $field['value'] . '"/>';
144
  $e .= '</div>';
145
 
146
  $e .= '</div>';
203
  $field['use_header'] = 0;
204
  }
205
 
206
+ if ( empty( $field['use_caption'] ) ) {
207
+
208
+ $field['use_caption'] = 2;
209
+ }
210
+
211
  // Create Field Options HTML
212
 
213
+ // USE HEADER
214
 
215
  echo '<tr class="field_option field_option_' . $this->name . '">';
216
  echo '<td class="label">';
217
  echo '<label>' . __( "Table Header", 'acf-table' ) . '</label>';
218
+ echo '<p class="description">' . __( "Presetting the usage of table header", 'acf-table' ) . '</p>';
219
  echo '</td>';
220
  echo '<td>';
221
 
229
  2 => __( "No", 'acf-table' ),
230
  ),
231
  'layout' => 'horizontal',
232
+ 'default_value' => 0,
233
+ ));
234
+
235
+ echo '</td>';
236
+ echo '</tr>';
237
+
238
+ // USER CAPTION
239
+
240
+ echo '<tr class="field_option field_option_' . $this->name . '">';
241
+ echo '<td class="label">';
242
+ echo '<label>' . __( "Table Caption", 'acf-table' ) . '</label>';
243
+ echo '<p class="description">' . __( "Presetting the usage of table caption", 'acf-table' ) . '</p>';
244
+ echo '</td>';
245
+ echo '<td>';
246
+
247
+ do_action('acf/create_field', array(
248
+ 'type' => 'radio',
249
+ 'name' => 'fields[' . $key . '][use_caption]',
250
+ 'value' => $field['use_caption'],
251
+ 'choices' => array(
252
+ 1 => __( "Yes", 'acf-table' ),
253
+ 2 => __( "No", 'acf-table' ),
254
+ ),
255
+ 'layout' => 'horizontal',
256
+ 'default_value' => 2,
257
  ));
258
 
259
  echo '</td>';
279
 
280
  function format_value_for_api( $value, $post_id, $field )
281
  {
282
+ if ( is_string( $value ) ) {
283
+
284
+ // CHECK FOR GUTENBERG BLOCK CONTENT (URL ENCODED JSON) {
285
+
286
+ if ( substr( $value , 0 , 1 ) === '%' ) {
287
+
288
+ $value = urldecode( $value );
289
+ }
290
+
291
+ // }
292
+
293
+ $value = json_decode( $value, true ); // decode gutenberg JSONs, but also old table JSONs strings to array
294
+ }
295
+
296
+ $a = $value;
297
 
298
  $value = false;
299
 
315
  $value['header'] = false;
316
  }
317
 
318
+ // IF CAPTION DATA
319
+
320
+ if (
321
+ ! empty( $field['use_caption'] ) AND
322
+ $field['use_caption'] === 1 AND
323
+ ! empty( $a['p']['ca'] )
324
+ ) {
325
+
326
+ $value['caption'] = $a['p']['ca'];
327
+ }
328
+ else {
329
+
330
+ $value['caption'] = false;
331
+ }
332
+
333
  // BODY
334
 
335
  $value['body'] = $a['b'];
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
  }
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
+ $value = array_replace_recursive( $data, $value );
392
  }
393
 
394
  return $value;
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.2.7',
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!
@@ -126,12 +126,26 @@ class acf_field_table extends acf_field {
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,29 +177,64 @@ class acf_field_table extends acf_field {
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,25 +425,26 @@ class acf_field_table extends acf_field {
376
 
377
  if ( is_string( $value ) ) {
378
 
379
- $value = urldecode( str_replace( '%5C', '%5C%5C', $value ) );
 
 
380
  }
381
 
382
  if ( is_array( $value ) ) {
383
 
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'];
390
  }
391
 
392
- if ( isset( $value['body'] ) ) {
393
 
394
- $data['b'] = $value['body'];
395
  }
396
 
397
- $value = wp_slash( json_encode( $data ) );
398
  }
399
 
400
  return $value;
@@ -418,7 +468,21 @@ class acf_field_table extends acf_field {
418
 
419
  function format_value( $value, $post_id, $field ) {
420
 
421
- $a = json_decode( $value, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
 
423
  $value = false;
424
 
@@ -440,6 +504,21 @@ class acf_field_table extends acf_field {
440
  $value['header'] = false;
441
  }
442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  // BODY
444
 
445
  $value['body'] = $a['b'];
21
  * settings (array) Array of settings
22
  */
23
  $this->settings = array(
24
+ 'version' => '1.3.1',
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!
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
+ 'default_value' => 0,
136
+ ));
137
+
138
+ acf_render_field_setting( $field, array(
139
+ 'label' => __('Table Caption','acf-table'),
140
+ 'instructions' => __('Presetting the usage of table caption','acf-table'),
141
+ 'type' => 'radio',
142
+ 'name' => 'use_caption',
143
+ 'choices' => array(
144
+ 1 => __( "Yes", 'acf-table' ),
145
+ 2 => __( "No", 'acf-table' ),
146
+ ),
147
+ 'layout' => 'horizontal',
148
+ 'default_value' => 2,
149
  ));
150
 
151
  }
177
  $field['use_header'] = 0;
178
  }
179
 
180
+ if ( empty( $field['use_caption'] ) ) {
181
+
182
+ $field['use_caption'] = 0;
183
+ }
184
+
185
  $data_field['use_header'] = $field['use_header'];
186
+ $data_field['use_caption'] = $field['use_caption'];
187
 
188
  $e = '';
189
 
190
  $e .= '<div class="acf-table-root">';
191
 
192
+ $e .= '<div class="acf-table-optionwrap">';
193
 
194
+ // OPTION HEADER {
195
 
196
+ if ( $data_field['use_header'] === 0 ) {
 
 
 
 
 
 
 
197
 
198
+ $e .= '<div class="acf-table-optionbox">';
199
+ $e .= '<label for="acf-table-opt-use-header">' . __( 'use table header', 'acf-table' ) . ' </label>';
200
+ $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">';
201
+ $e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
202
+ $e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
203
+ $e .= '</select>';
204
+ $e .= '</div>';
205
+ }
206
+
207
+ // }
208
+
209
+ // OPTION CAPTION {
210
+
211
+ if ( $data_field['use_caption'] === 1 ) {
212
+
213
+ $e .= '<div class="acf-table-optionbox">';
214
+ $e .= '<label for="acf-table-opt-caption">' . __( 'table caption', 'acf-table' ) . ' </label><br>';
215
+ $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>';
216
+ $e .= '</div>';
217
+ }
218
+
219
+ // }
220
+
221
+ $e .= '</div>';
222
+
223
+ if ( is_array( $field['value'] ) ) {
224
+
225
+ $field['value'] = wp_json_encode( $field['value'] );
226
+ }
227
+
228
+ if ( is_string( $field['value'] ) ) {
229
+
230
+ if ( substr( $field['value'] , 0 , 1 ) === '{' ) {
231
+
232
+ $field['value'] = urlencode( $field['value'] );
233
+ }
234
+ }
235
 
236
  $e .= '<div class="acf-input-wrap">';
237
+ $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'] . '"/>';
238
  $e .= '</div>';
239
 
240
  $e .= '</div>';
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
  }
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
+ $value = array_replace_recursive( $data, $value );
448
  }
449
 
450
  return $value;
468
 
469
  function format_value( $value, $post_id, $field ) {
470
 
471
+ if ( is_string( $value ) ) {
472
+
473
+ // CHECK FOR GUTENBERG BLOCK CONTENT (URL ENCODED JSON) {
474
+
475
+ if ( substr( $value , 0 , 1 ) === '%' ) {
476
+
477
+ $value = urldecode( $value );
478
+ }
479
+
480
+ // }
481
+
482
+ $value = json_decode( $value, true ); // decode gutenberg JSONs, but also old table JSONs strings to array
483
+ }
484
+
485
+ $a = $value;
486
 
487
  $value = false;
488
 
504
  $value['header'] = false;
505
  }
506
 
507
+ // IF CAPTION DATA
508
+
509
+ if (
510
+ ! empty( $field['use_caption'] ) AND
511
+ $field['use_caption'] === 1 AND
512
+ ! empty( $a['p']['ca'] )
513
+ ) {
514
+
515
+ $value['caption'] = $a['p']['ca'];
516
+ }
517
+ else {
518
+
519
+ $value['caption'] = false;
520
+ }
521
+
522
  // BODY
523
 
524
  $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.2.7
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.3.1
7
  Author: Johann Heyne
8
  Author URI: http://www.johannheyne.de/
9
  License: GPLv2 or later
changelog.txt ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
7
+ = 1.3.0 =
8
+ * Adds support for table caption
9
+ * Fixes an JavaScript issue for ACF version 4
10
+
11
+ = 1.2.6 =
12
+ * Replaces jQuery.noConflict methode
13
+ * Prevents PHP error if table fields value is from a previous fieldtype
14
+
15
+ = 1.2.5 =
16
+ * Adds danish translation, thanks to Jeppe Skovsgaard
17
+
18
+ = 1.2.4 =
19
+ * Fixes backslashes on using update_field();
20
+
21
+ = 1.2.3 =
22
+ * 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.
23
+
24
+ = 1.2.2 =
25
+ * Adds plugin version to table data for handling structural changes.
26
+ * 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.
27
+ * Fixes an PHP warning since PHP 7.2 when body data is null
28
+
29
+ = 1.2.1 =
30
+ * Fixes not using user locale for translation
31
+ * Adds description for handling line breaks to plugins page
32
+
33
+ = 1.2 =
34
+ * Adds support for tab navigation. Uses shift + tab for backward navigation.
35
+ * Minor code improvements
36
+
37
+ = 1.1.16 =
38
+ * Keeps the WordPress admin area working, if tablefields value is not a valid JSON string. Logs the invalid value in the console for debugging.
39
+
40
+ = 1.1.15 =
41
+ * Adds polish translation by Pawel Golka
42
+
43
+ = 1.1.14 =
44
+ * Fixes table does not appear under certain field groups location rules
45
+
46
+ = 1.1.13 =
47
+ * Fixes an XSS issue within /wp-admin/ pages
48
+
49
+ = 1.1.12 =
50
+ * Adds support for field groups post taxonomy rule
51
+
52
+ = 1.1.11 =
53
+ * Fixes rerendering of tables while changing other content
54
+
55
+ = 1.1.10 =
56
+ * Fixed table functionality with respect to the ACF rules
57
+
58
+ = 1.1.9 =
59
+ * Fixes returning false on single empty table cell for ACF version 4
60
+
61
+ = 1.1.8 =
62
+ * Fixes support for user edit pages
63
+
64
+ = 1.1.7 =
65
+ * Fixes support for user profile pages
66
+
67
+ = 1.1.6 =
68
+ * UI: Fixes table header switch off problem
69
+
70
+ = 1.1.5 =
71
+ * Fixes issue occured after database migration with plugin "WP Migrate DB"
72
+
73
+ = 1.1.4 =
74
+ * Takes over icon class changes in ACF-Pro since version 5.3.2
75
+
76
+ = 1.1.3 =
77
+ * Fixes wrong function name 'change_template'
78
+
79
+ = 1.1.2 =
80
+ * Fixes missing table on page template change
81
+
82
+ = 1.1.1 =
83
+ * Compatibility to icon changes of ACF Pro version 5.2.8
84
+ * Fixes table top legend height in FireFox
85
+ * Fixes delete column icon position in IE
86
+
87
+ = 1.1 =
88
+ * Improved User Experience when deleting all columns and rows.
89
+ * Compatibility to changes of ACF Pro version 5.2.7.
90
+
91
+ = 1.0.7 =
92
+ * Use wp_json_encode() instead of json_encode(). This may fix issues in rare enviroments.
93
+
94
+ = 1.0.6 =
95
+ * If the table has only a single empty cell (this is by default), no table data will return now.
96
+
97
+ = 1.0.5 =
98
+ * Fixes javascript issue in IE 8.
99
+ * Fixes missing table borders and table header´s height in FireFox.
100
+
101
+ = 1.0.4 =
102
+ * Fixes an uri problem on some hosts.
103
+
104
+ = 1.0.3 =
105
+ * Fixes an php error on HTTP_REFFERER.
106
+
107
+ = 1.0.2 =
108
+ * Fixes error when including the plugin from inside a theme.
109
+
110
+ = 1.0.1 =
111
+ * Fixes ACF validation error "required" when header option "use table header" was used and unchecked.
112
+
113
+ = 1.0 =
114
+ * 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,19 +304,37 @@
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 } */
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-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 } */
js/input-v4.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.2.7';
8
 
9
  t.param = {};
10
 
@@ -96,7 +96,8 @@
96
 
97
  t.state = {
98
  'current_cell_obj': false,
99
- 'cell_editor_cell': false
 
100
  };
101
 
102
  t.init = function() {
@@ -117,6 +118,7 @@
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,6 +241,29 @@
239
  // }
240
  };
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  t.ui_event_new_flex_field = function() {
243
 
244
  t.obj.body.on( 'click', '.acf-fc-popup', function() {
@@ -301,8 +326,9 @@
301
 
302
  p: {
303
  o: {
304
- uh: 0,
305
  },
 
306
  },
307
 
308
  // from data-colparam
@@ -450,6 +476,12 @@
450
 
451
  t.misc_render = function( p ) {
452
 
 
 
 
 
 
 
453
  // VARS {
454
 
455
  var v = {};
@@ -512,6 +544,33 @@
512
  // }
513
 
514
  // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  };
516
 
517
  t.table_add_col_event = function() {
4
 
5
  var t = this;
6
 
7
+ t.version = '1.3.1';
8
 
9
  t.param = {};
10
 
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
  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
  // }
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
 
327
  p: {
328
  o: {
329
+ uh: 0, // use header
330
  },
331
+ ca: '', // caption content
332
  },
333
 
334
  // from data-colparam
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
  // }
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() {
js/input-v5.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  var t = this;
6
 
7
- t.version = '1.2.7';
8
 
9
  t.param = {};
10
 
@@ -118,6 +118,7 @@
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,6 +241,29 @@
240
  // }
241
  };
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  t.ui_event_new_flex_field = function() {
244
 
245
  t.obj.body.on( 'click', '.acf-fc-popup', function() {
@@ -269,19 +293,49 @@
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,8 +356,9 @@
302
 
303
  p: {
304
  o: {
305
- uh: 0,
306
  },
 
307
  },
308
 
309
  // from data-colparam
@@ -451,6 +506,12 @@
451
 
452
  t.misc_render = function( p ) {
453
 
 
 
 
 
 
 
454
  // VARS {
455
 
456
  var v = {};
@@ -513,6 +574,33 @@
513
  // }
514
 
515
  // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  };
517
 
518
  t.table_add_col_event = function() {
@@ -831,7 +919,18 @@
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,6 +1223,14 @@
1124
 
1125
  };
1126
 
 
 
 
 
 
 
 
 
1127
  t.sort_cols = function( p ) {
1128
 
1129
  p.obj_table.find('.acf-table-header-row').each( function() {
4
 
5
  var t = this;
6
 
7
+ t.version = '1.3.1';
8
 
9
  t.param = {};
10
 
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
  // }
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
 
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
 
357
  p: {
358
  o: {
359
+ uh: 0, // use header
360
  },
361
+ ca: '', // caption content
362
  },
363
 
364
  // from data-colparam
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
  // }
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
 
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
 
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() {
lang/acf-table-da_DK.mo CHANGED
Binary file
lang/acf-table-da_DK.po CHANGED
@@ -2,28 +2,46 @@
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,10 +54,6 @@ msgstr "Advanced Custom Fields: Table Field"
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,23 +63,32 @@ msgid "Table Header"
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"
 
 
 
 
 
 
 
 
 
 
 
 
 
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.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/"
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
  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"
lang/acf-table-de_DE.mo CHANGED
Binary file
lang/acf-table-de_DE.po CHANGED
@@ -9,30 +9,86 @@ 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 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"
 
 
 
 
 
 
 
 
 
 
 
 
 
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.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/"
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."
lang/acf-table-pl_PL.mo CHANGED
Binary file
lang/acf-table-pl_PL.po CHANGED
@@ -9,30 +9,71 @@ 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 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"
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.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 ""
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"
lang/acf-table.pot CHANGED
@@ -1,37 +1,75 @@
 
 
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 ""
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.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 ""
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 ""
readme.txt CHANGED
@@ -1,10 +1,10 @@
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,17 +17,20 @@ 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
- = 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
29
  * To move to the previous cells editor press key: shift + tab
30
 
 
 
 
 
 
31
  == Frequently Asked Questions ==
32
 
33
  = How to output the table html? =
@@ -37,10 +40,15 @@ To render the table fields data as an html table in one of your template files (
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,6 +173,11 @@ For now the way to go is using the Elementors shortcode Widget. Before you can u
165
 
166
  $return .= '<table border="0">';
167
 
 
 
 
 
 
168
  if ( $table['header'] ) {
169
 
170
  $return .= '<thead>';
@@ -265,11 +278,20 @@ However, only when activated as a plugin will updates be available.
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
 
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.3.1
7
+ Requires PHP: 5.6
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
  = 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
27
  * To move to the previous cells editor press key: shift + tab
28
 
29
+ = ACF Pro 5.8 will introduce Blocks for Gutenberg =
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? =
40
  `
41
  $table = get_field( 'your_table_field_name' );
42
 
43
+ if ( ! empty ( $table ) ) {
44
 
45
  echo '<table border="0">';
46
 
47
+ if ( ! empty( $table['caption'] ) ) {
48
+
49
+ echo '<caption>' . $table['caption'] . '</caption>';
50
+ }
51
+
52
  if ( ! empty( $table['header'] ) ) {
53
 
54
  echo '<thead>';
173
 
174
  $return .= '<table border="0">';
175
 
176
+ if ( ! empty( $table['caption'] ) ) {
177
+
178
+ echo '<caption>' . $table['caption'] . '</caption>';
179
+ }
180
+
181
  if ( $table['header'] ) {
182
 
183
  $return .= '<thead>';
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
290
+
291
+ = 1.3.0 =
292
+ * Adds support for table caption
293
+ * Fixes an JavaScript issue for ACF version 4
294
+
295
  = 1.2.7 =
296
  * 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().
297