Make WordPress Core


Ignore:
Timestamp:
09/29/2023 03:05:40 PM (18 months ago)
Author:
adamsilverstein
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php

    r56714 r56745  
    33653365     *
    33663366     * @group revision
    3367      * @dataProvider test_revisioned_single_post_meta_with_posts_endpoint_page_and_cpt_data_provider
     3367     * @dataProvider data_revisioned_single_post_meta_with_posts_endpoint_page_and_cpt_data_provider
    33683368     */
    33693369    public function test_revisioned_single_post_meta_with_posts_endpoint_page_and_cpt( $passed, $expected, $post_type ) {
     
    34523452     * Provide data for the meta revision checks.
    34533453     */
    3454     public function test_revisioned_single_post_meta_with_posts_endpoint_page_and_cpt_data_provider() {
     3454    public function data_revisioned_single_post_meta_with_posts_endpoint_page_and_cpt_data_provider() {
    34553455        return array(
    34563456            array(
     
    34693469                'cpt',
    34703470            ),
    3471 
    34723471        );
    34733472    }
Note: See TracChangeset for help on using the changeset viewer.