get_block_template WordPress Filter Hook

The get_block_template hook is used to specify the template that should be used to render the content of a block. This hook is called when a block is being rendered.

apply_filters( 'get_block_template', WP_Block_Template|null $block_template, string $id, array $template_type ) #

Filters the queried block template object after it’s been fetched.


Parameters

$block_template

(WP_Block_Template|null)The found block template, or null if there isn't one.

$id

(string)Template unique identifier (example: theme_slug//template_slug).

$template_type

(array)Template type: 'wp_template' or 'wp_template_part'.


Top ↑

Source

File: wp-includes/block-template-utils.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.