Editor: Correctly back up the global `$post` in `wp-admin/edit-form-blocks.php`.

To create a copy of the object, instead of a reference to the same object, the `clone` keyword should be used.

Props scarolan.
Fixes #50775.

git-svn-id: https://develop.svn.wordpress.org/trunk@48700 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-31 13:58:09 +00:00
parent e95d64569c
commit bfc5c53189
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ $preload_paths = apply_filters( 'block_editor_preload_paths', $preload_paths, $p
* Because API preloading can call the_content and other filters, plugins * Because API preloading can call the_content and other filters, plugins
* can unexpectedly modify $post. * can unexpectedly modify $post.
*/ */
$backup_global_post = $post; $backup_global_post = clone $post;
$preload_data = array_reduce( $preload_data = array_reduce(
$preload_paths, $preload_paths,