pre_get_block_templates

pre_get_block_templates

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('pre_get_block_templates') is found 1 times:

  • /wp-includes/block-template-utils.php line 1099
    	 *     @type string   $post_type Post type to get the templates for.
    	 * }
    	 * @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'.
    	 */
    	$templates = apply_filters( 'pre_get_block_templates', null, $query, $template_type );
    	if ( ! is_null( $templates ) ) {
    		return $templates;
    	}
    
    	$post_type     = isset( $query['post_type'] ) ? $query['post_type'] : '';
    	$wp_query_args = array(
    

See this hook used in plugins: