Advanced Custom Fields: Table Field - Version 1.3.14

Version Description

  • Prevents the font-size and line-height in the blue editor window of the table cells from being overwritten by other styles.
  • Fixes an issue in update_field() where setting the "use_header" option to false did not work.
Download this release

Release Info

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

Code changes from version 1.3.13 to 1.3.14

Files changed (4) hide show
  1. acf-table-v5.php +6 -2
  2. changelog.txt +4 -0
  3. css/input.css +2 -2
  4. readme.txt +57 -5
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.13',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
@@ -459,10 +459,14 @@ class acf_field_table extends acf_field {
459
  $data = json_decode( $data, true );
460
  }
461
 
462
- if ( isset( $value['use_header'] ) ) {
463
 
464
  $data['p']['o']['uh'] = 1;
465
  }
 
 
 
 
466
 
467
  if ( isset( $value['caption'] ) ) {
468
 
21
  * settings (array) Array of settings
22
  */
23
  $this->settings = array(
24
+ 'version' => '1.3.14',
25
  'dir_url' => plugins_url( '', __FILE__ ) . '/',
26
  );
27
 
459
  $data = json_decode( $data, true );
460
  }
461
 
462
+ if ( ! empty( $value['use_header'] ) ) {
463
 
464
  $data['p']['o']['uh'] = 1;
465
  }
466
+ else {
467
+
468
+ $data['p']['o']['uh'] = 0;
469
+ }
470
 
471
  if ( isset( $value['caption'] ) ) {
472
 
changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  == Changelog ==
2
 
 
 
 
 
3
  = 1.3.13 =
4
  * Fixes missing sortable columns and rows in ACF Gutenberg blocks
5
  * Updates depricated jQuery functionalities
1
  == Changelog ==
2
 
3
+ = 1.3.14 =
4
+ * Prevents the font-size and line-height in the blue editor window of the table cells from being overwritten by other styles.
5
+ * Fixes an issue in update_field() where setting the "use_header" option to false did not work.
6
+
7
  = 1.3.13 =
8
  * Fixes missing sortable columns and rows in ACF Gutenberg blocks
9
  * Updates depricated jQuery functionalities
css/input.css CHANGED
@@ -286,8 +286,8 @@
286
  border: none !important;
287
  padding: 3px 7px !important;
288
  background-color: #e5f8ff;
289
- font-size: 13px;
290
- line-height: 1.4;
291
  min-width: 180px;
292
  min-height: 61px !important;
293
 
286
  border: none !important;
287
  padding: 3px 7px !important;
288
  background-color: #e5f8ff;
289
+ font-size: 14px !important;
290
+ line-height: 1.4 !important;
291
  min-width: 180px;
292
  min-height: 61px !important;
293
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: jonua
3
  Tags: acf table
4
  Requires at least: 5.3
5
- Tested up to: 5.7.2
6
- Stable tag: 1.3.13
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
@@ -235,13 +235,61 @@ Or you can **insert a table from a ACF option page**…
235
 
236
  You can use the ACF PHP function `update_field()` to change a tables data.
237
 
238
- Example: adding a new row
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  `
240
  // the post ID where to update the table field
241
  $post_id = 123;
242
 
243
  // gets the table data
244
- $table_data = get_field( 'table', $post_id );
245
 
246
  // defines the new row and its columns
247
  $new_row = array(
@@ -264,7 +312,7 @@ $new_row = array(
264
  array_push( $table_data['body'], $new_row );
265
 
266
  // saves the new table data
267
- update_field( 'table', $table_data, $post_id );
268
  `
269
 
270
  = Third party plugins issues =
@@ -309,6 +357,10 @@ However, only when activated as a plugin will updates be available.
309
 
310
  == Changelog ==
311
 
 
 
 
 
312
  = 1.3.13 =
313
  * Fixes missing sortable columns and rows in ACF Gutenberg blocks
314
  * Updates depricated jQuery functionalities
2
  Contributors: jonua
3
  Tags: acf table
4
  Requires at least: 5.3
5
+ Tested up to: 6.0
6
+ Stable tag: 1.3.14
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
 
235
 
236
  You can use the ACF PHP function `update_field()` to change a tables data.
237
 
238
+ __Notice__
239
+
240
+ - Make sure that the number of entries in the header array matches the number of cells in the body rows.
241
+ - The array key 'c' stands for the content of the cells to have the option of adding other cell setting in future development.
242
+ - The table data obtained by get_field() are formatted and differ by the original database data obtained by get_post_meta().
243
+
244
+ __Example of changing table data using get_field() and update_field()__
245
+
246
+ `
247
+ // the post ID where to update the table field
248
+ $post_id = 123;
249
+
250
+ $table_data = get_field( 'my_table', $post_id );
251
+
252
+ $table_data = array(
253
+ 'use_header' => true, // boolean true/false
254
+ 'caption' => 'My Caption',
255
+ 'header' => array(
256
+ 0 => array(
257
+ 'c' => 'A',
258
+ ),
259
+ 1 => array(
260
+ 'c' => 'B',
261
+ ),
262
+ ),
263
+ 'body' => array(
264
+ 0 => array(
265
+ 0 => array(
266
+ 'c' => 'The content of first cell of first row',
267
+ ),
268
+ 1 => array(
269
+ 'c' => 'The content of second cell of first row',
270
+ ),
271
+ ),
272
+ 1 => array(
273
+ 0 => array(
274
+ 'c' => The content of first cell of second row',
275
+ ),
276
+ 1 => array(
277
+ 'c' => 'The content of second cell of second row',
278
+ ),
279
+ ),
280
+ )
281
+ );
282
+
283
+ update_field( 'my_table', $table_data, $post_id );
284
+ `
285
+
286
+ __Example of adding a new row__
287
  `
288
  // the post ID where to update the table field
289
  $post_id = 123;
290
 
291
  // gets the table data
292
+ $table_data = get_field( 'my_table', $post_id );
293
 
294
  // defines the new row and its columns
295
  $new_row = array(
312
  array_push( $table_data['body'], $new_row );
313
 
314
  // saves the new table data
315
+ update_field( 'my_table', $table_data, $post_id );
316
  `
317
 
318
  = Third party plugins issues =
357
 
358
  == Changelog ==
359
 
360
+ = 1.3.14 =
361
+ * Prevents the font-size and line-height in the blue editor window of the table cells from being overwritten by other styles.
362
+ * Fixes an issue in update_field() where setting the "use_header" option to false did not work.
363
+
364
  = 1.3.13 =
365
  * Fixes missing sortable columns and rows in ACF Gutenberg blocks
366
  * Updates depricated jQuery functionalities