Skip to content

Commit

Permalink
Make getting correct wp_template post more error-proof
Browse files Browse the repository at this point in the history
Co-Authored-By: Weston Ruter <[email protected]>
  • Loading branch information
2 people authored and epiqueras committed Oct 23, 2019
1 parent 7bdcd6d commit 8f1529a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function gutenberg_find_template( $template_file ) {

if ( $template_query->have_posts() ) {
$template_posts = $template_query->get_posts();
$_wp_current_template_post = $template_posts[0];
$_wp_current_template_post = array_shift( $template_posts );
}

// Add extra hooks for template canvas.
Expand Down

0 comments on commit 8f1529a

Please sign in to comment.