apply_filters( 'pre_get_block_templates', WP_Block_Template[]|null $block_templates, array $query, string $template_type )

Filters the block templates array before the query takes place.


Return a non-null value to bypass the WordPress queries.

Top ↑



(WP_Block_Template[]|null) Return an array of block templates to short-circuit the default query, or null to allow WP to run it's normal queries.


(array) Arguments to retrieve templates.

  • 'slug__in'
    (array) List of slugs to include.
  • 'wp_id'
    (int) Post ID of customized template.
  • 'post_type'
    (string) Post type to get the templates for.


(string) wp_template or wp_template_part.

Top ↑


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

View on Trac

Top ↑


Version Description
5.9.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.