From 1563bf73446c4de50926ff4006dee5e881a6b1e8 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 20 Mar 2025 23:01:33 +0000 Subject: [PATCH] Site Editor: Fix PHP warning pre-loading page REST requests. Fix a PHP warning when opening a page directly in the site editor, eg by navigating to the URL `/wp-admin/site-editor.php?p=%2Fpage&postId=200`, caused by an undefined variable name. Props abcd95, joemcgill, narenin, soyebsalar, websiteredev, wildworks. Fixes #63122. git-svn-id: https://develop.svn.wordpress.org/trunk@60061 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/site-editor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php index 21965f7318..0f1415ea9b 100644 --- a/src/wp-admin/site-editor.php +++ b/src/wp-admin/site-editor.php @@ -239,7 +239,7 @@ if ( $block_editor_context->post ) { $preload_paths[] = add_query_arg( 'slug', // @see https://github.com/WordPress/gutenberg/blob/e093fefd041eb6cc4a4e7f67b92ab54fd75c8858/packages/core-data/src/private-selectors.ts#L244-L254 - empty( $block_editor_context->post->post_name ) ? 'page' : 'page-' . $post->post_name, + empty( $block_editor_context->post->post_name ) ? 'page' : 'page-' . $block_editor_context->post->post_name, '/wp/v2/templates/lookup' ); }