Escape backslashes stripped from JSON strings when scheduling post
-
Hi,
I know this plugin hasn’t been updated in a while and therefore can’t be expected to function with newer sites, but everything was working great for me except my background color variables with “–” were getting messed up because the scheduled posts had their escape characters stripped out, so"background-color":"var(\u002d\u002dast-global-color-4)"was coming through as"background-color":"var(u002du002dast-global-color-4)"Backslash stripping is a known issue when using wp_insert_post, so I looked at the plugin and on line 550 of tao-schedule-update.php, replaced:
$new_post_id = wp_insert_post( $new_post );
with$new_post_id = wp_insert_post( wp_slash( (array) $new_post ) );Is this the best way to handle this issue, and if so, can this (or a better fix) be implemented in the next update of this plugin?
Thanks!
The topic ‘Escape backslashes stripped from JSON strings when scheduling post’ is closed to new replies.