From bfc5c53189ac79b67907580788cc349df3e596ec Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 31 Jul 2020 13:58:09 +0000 Subject: [PATCH] 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 --- src/wp-admin/edit-form-blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 4e104feda2..c1c37487ef 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -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 * can unexpectedly modify $post. */ -$backup_global_post = $post; +$backup_global_post = clone $post; $preload_data = array_reduce( $preload_paths,