pre_get_block_template

pre_get_block_template

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

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('pre_get_block_template') is found 1 times:

  • /wp-includes/block-template-utils.php line 1236

    * or null to allow WP to run its normal queries.
    * @param string $id Template unique identifier (example: ‘theme_slug//template_slug’).
    * @param string $template_type Template type. Either ‘wp_template’ or ‘wp_template_part’.
    */
    $block_template = apply_filters( ‘pre_get_block_template’, null, $id, $template_type );
    if ( ! is_null( $block_template ) ) {
    return $block_template;
    }

    $parts = explode( ‘//’, $id, 2 );
    if ( count( $parts ) < 2 ) { [/php]

See this hook used in plugins: