WordPress.org

Make WordPress Core

Ticket #41738: 41738.diff

File 41738.diff, 1.3 KB (added by dlh, 4 years ago)
  • src/wp-includes/class-wp-customize-manager.php

     
    816816                if ( ! empty( $changeset_post_query->posts ) ) {
    817817                        // Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.
    818818                        $changeset_post_id = $changeset_post_query->posts[0]->ID;
    819                         wp_cache_set( $this->_changeset_uuid, $changeset_post_id, $cache_group );
     819                        wp_cache_set( $uuid, $changeset_post_id, $cache_group );
    820820                        return $changeset_post_id;
    821821                }
    822822
  • tests/phpunit/tests/customize/manager.php

     
    303303                $wp_customize = new WP_Customize_Manager();
    304304                $this->assertNull( $wp_customize->find_changeset_post_id( wp_generate_uuid4() ) );
    305305                $this->assertEquals( $post_id, $wp_customize->find_changeset_post_id( $uuid ) );
     306
     307                // Verify that the found post ID was cached under the given UUID, not the manager's UUID.
     308                $this->assertNotEquals( $post_id, $wp_customize->find_changeset_post_id( $wp_customize->changeset_uuid() ) );
    306309        }
    307310
    308311        /**