Filters the block template object before the query takes place. Return a non-null value to bypass the WordPress queries.
$id, $template_type = 'wp_template'
Sortie :
@param WP_Block_Template|null $block_template Return block template object to short-circuit the default query, @param string $id Template unique identifier (example: 'theme_slug//template_slug'). @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'. @param WP_Block_Template|null $block_template The found block template, or null if there isn't one. @param string $id Template unique identifier (example: 'theme_slug//template_slug'). @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'. @param string $id Template unique identifier (example: 'theme_slug//template_slug'). @param string $template_type Optional. Template type. Either 'wp_template' or 'wp_template_part'. @return WP_Block_Template|null The found block template, or null if there isn't one.
// Utilisation de la fonction get_block_file_template
$result = get_block_file_template($id, $template_type = 'wp_template');
if ($result) {
// Votre logique ici
}
Chargement des actualités...