Title: get_block_template
Published: February 3, 2022
Last modified: February 24, 2026

---

# apply_filters( ‘get_block_template’, WP_Block_Template|null $block_template, string $id, string $template_type )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#wp--skip-link--target)

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#parameters)󠁿

 `$block_template`[WP_Block_Template](https://developer.wordpress.org/reference/classes/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`string

Template type. Either `'wp_template'` or `'wp_template_part'`.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'get_block_template', $block_template, $id, $template_type );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/block-template-utils.php#L1335)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/block-template-utils.php#L1335-L1335)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#related)󠁿

| Used by | Description | 
| [get_block_template()](https://developer.wordpress.org/reference/functions/get_block_template/)`wp-includes/block-template-utils.php` |

Retrieves a single unified template object using its id.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/get_block_template/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fget_block_template%2F)
before being able to contribute a note or feedback.