Skip to content

Commit

Permalink
Add rendering_template action (WordPress#32309)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed May 28, 2021
1 parent 7fbe674 commit 8fb284b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/full-site-editing/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ function gutenberg_override_query_template( $template, $type, array $templates )

$block_template = gutenberg_resolve_template( $type, $templates );

/**
* Fires before the template is rendered.
*
* Allows extensions to follow template processing.
* Called before the template is rendered.
*
* @param object $current_template The current template object.
* @param string $type Sanitized filename without extension.
* @param array $templates A list of template candidates, in descending order of priority.
*/
do_action( 'rendering_template', $block_template, $type, $templates );

if ( $block_template ) {
if ( empty( $block_template->content ) && is_user_logged_in() ) {
$_wp_current_template_content =
Expand Down

0 comments on commit 8fb284b

Please sign in to comment.