Johann Heyne
Forum Replies Created
-
Can you please redownload and install the Table plugin again and check, if it is working now?
OK, I will check this problem again.
The issue you described is solved in the Table Field plugin version 1.1.10
This issue should be fixed in version 1.1.10
Some ACF group rules like post status will affect only after saving the changes. This is to all ACF fields in general and may be fixed in future by ACF.
Thanks for reporting this. I´m going to fix it in the next 24 hours.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty Table ShowingThank you for the details. I fixed it with version 1.1.9
Thanks for reporting that issue!
OK, I understand. Why PHP must be inserting the record into the DB as a number? Do you mean the database field type or a value in the JSON string?
Version 1.1.8 should enable editing users table data.
Thanks for reporting that issue!A tables data is stored in a single custom field as a JSON string in the database like this…
"{"p":{"o":{"uh":1}},"c":[{"p":""},{"p":""}],"h":[{"c":"Title"},{"c":"Title"}],"b":[[{"c":"Value 1"},{"c":"Value 1"}]]}"If you catch the fields value without an ACF function like get_field(), you get this JSON string returned. To get the data as an array, you have to use get_field().
You could use the following function to decode the JSON string data into the array.
function acf_table_json_decode( $json ) { $a = json_decode( $json, true ); $return = false; // IF BODY DATA if ( count( $a['b'] ) > 0 ) { // IF HEADER DATA if ( $a['p']['o']['uh'] === 1 ) { $return['header'] = $a['h']; } else { $return['header'] = false; } // BODY $return['body'] = $a['b']; // IF SINGLE EMPTY CELL, THEN DO NOT RETURN TABLE DATA if ( count( $a['b'] ) === 1 AND count( $a['b'][0] ) === 1 AND trim( $a['b'][0][0]['c'] ) === '' ) { $return = false; } } return $return; }To your second request I will reply later.
Hello acodesmith,
thanks for reporting me this issue. Can you please tell me the browser and version?
Thanks much,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Table field in user profile not showingVersion 1.1.7 should fix that issue.
Thanks for reporting that issue!Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Table field in user profile not showingHello kronoswolf, I try to fix it today. Thanks
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Shortcodes in table/tdAn issue could be, that the returning content of the shortcode contains special characters, which breaks the JSON format of the table data. A solution is to encode the content into JSON format and removing the surrounding quotes of the JSON string.
function my_shortcode( $atts ) { $return = 'Something with JSON special characters like "quotes" and \backslashes.'; // encoding to JSON escapes JSON special characters $return = json_encode( $return ); // removing surrounding quotes of the JSON string $return = trim( $return, '"' ); return $return; } add_shortcode( 'foobar', 'my_shortcode', 10, 3 );Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Shortcodes in table/tdDoing shortcodes via filters for table fields.
// ACF Version 5 function my_acf_format_value_v5 ( $value, $post_id, $field ) { $value = do_shortcode( $value ); return $value; } add_filter( 'acf/format_value/type=table', 'my_acf_format_value_v5', 10, 3 ); // ACF Version 4 function my_acf_format_value_v4 ( $value, $post_id, $field ) { /* The value of a table field is given as an array in ACF version 4 and has to be converted into a string (JSON) for doing shortcodes. */ if ( $field['type'] == 'table' ) { $value = wp_json_encode( $value ); } $value = do_shortcode( $value ); /* Just convert JSON string back into an array. Be sure, that the second parameter of json_decode() is true for returning an array, not object. */ if ( $field['type'] == 'table' ) { $value = json_decode( $value, true ); } return $value; } add_filter( 'acf/format_value_for_api', 'my_acf_format_value_v4', 10, 3 );Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Shortcodes in table/tdWhat ACF version do you use, 4 or 5?