WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #46314, comment 2


Ignore:
Timestamp:
02/22/2019 12:26:50 PM (18 months ago)
Author:
Jonua
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #46314, comment 2

    initial v1  
    33I build a plugin years ago https://de.wordpress.org/plugins/advanced-custom-fields-table-field/ which has more than 20.000 active users now. That plugin adds table editing functionality for the Advanced Custom Fields Plugin. The user editing UI of the table is pure JavaScript driven. To save the table data (a JavaScript object) to WordPress meta, I had to use an input text field. At first glance, it was logical to me, to encode and save the data JavaScript object as JSON string. Well, this was a bad decision resulting in trouble. This annoyance drew my attention to the general problem of update_post_meta() removing backslashes.
    44
    5 I would at least suggest that in the documentation to update_post_meta () should pointed out, if one reads foreign meta data and stores them again with update_post_meta, that wp_slash() must be applied beforehand, in order not to change the original data.
     5I would at least suggest that in the documentation to update_post_meta() should pointed out, if one reads foreign meta data and stores them again with update_post_meta(), that wp_slash() must be applied beforehand, in order not to change the original data.
    66
    77Thanks,