{$type}_template

FILTER wp-includes\template.php (ligne 103) github
Filters the path of the queried template by type. The dynamic portion of the hook name, `$type`, refers to the filename -- minus the file extension and any non-alphanumeric characters delimiting words -- of the file to load. This hook also applies to various types of files loaded as part of the Template Hierarchy. Possible hook names include:  - `404_template`  - `archive_template`  - `attachment_template`  - `author_template`  - `category_template`  - `date_template`  - `embed_template`  - `frontpage_template`  - `home_template`  - `index_template`  - `page_template`  - `paged_template`  - `privacypolicy_template`  - `search_template`  - `single_template`  - `singular_template`  - `tag_template`  - `taxonomy_template`

Paramètres

Entrée :
$template, $type, $templates
Sortie :
@param string   $template  Path to the template. See locate_template().
@param string   $type      Sanitized filename without extension.
@param string[] $templates A list of template candidates, in descending order of priority.

Utilisation

// Modifier la valeur avec le filtre '{$type}_template'
add_filter('{$type}_template', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($template) {
    // Modifier la valeur
    return $template;
}

Actualités

Chargement des actualités...