From 521bf3b459679baed1ef8f259534bca9d4834c85 Mon Sep 17 00:00:00 2001 From: epiqueras Date: Mon, 2 Dec 2019 13:31:23 -0800 Subject: [PATCH 1/2] Template Loader: Fix rebase mistake. --- lib/template-loader.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/template-loader.php b/lib/template-loader.php index b24fe4588c9de7..174cb7319f6209 100644 --- a/lib/template-loader.php +++ b/lib/template-loader.php @@ -192,9 +192,8 @@ function gutenberg_find_template( $template_file ) { (object) $current_template_post ); } - - $_wp_current_template_content = $current_template_post->post_content; } + $_wp_current_template_content = $current_template_post->post_content; // Add extra hooks for template canvas. add_action( 'wp_head', 'gutenberg_viewport_meta_tag', 0 ); From 2f18a4aeb3a31d8798f028a742755109a558176b Mon Sep 17 00:00:00 2001 From: epiqueras Date: Mon, 2 Dec 2019 14:12:55 -0800 Subject: [PATCH 2/2] Template Loader: Add separate if guard. --- lib/template-loader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/template-loader.php b/lib/template-loader.php index 174cb7319f6209..59ef444afaa05e 100644 --- a/lib/template-loader.php +++ b/lib/template-loader.php @@ -193,7 +193,10 @@ function gutenberg_find_template( $template_file ) { ); } } - $_wp_current_template_content = $current_template_post->post_content; + + if ( $current_template_post ) { + $_wp_current_template_content = $current_template_post->post_content; + } // Add extra hooks for template canvas. add_action( 'wp_head', 'gutenberg_viewport_meta_tag', 0 );