mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Revisions: slash meta values for autosave (preview) revisions.
Correct an issue where meta values containing characters like quote `”` could not be previewed on published posts. The function `update_metadata` expects data to be slashed. Also, add a test to confirm that storing JSON data which requires slashing in autosave meta works as expected, and improve naming for a data provider added in [56714]. Follow up to [56714]. Props mukesh27, spacedmonkey. Fixes #20564. git-svn-id: https://develop.svn.wordpress.org/trunk@56745 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -421,7 +421,7 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
|
||||
if ( ! empty( $meta ) ) {
|
||||
foreach ( $revisioned_meta_keys as $meta_key ) {
|
||||
if ( isset( $meta[ $meta_key ] ) ) {
|
||||
update_metadata( 'post', $revision_id, $meta_key, $meta[ $meta_key ] );
|
||||
update_metadata( 'post', $revision_id, $meta_key, wp_slash( $meta[ $meta_key ] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user