the_title

FILTER wp-includes\rest-api\endpoints\class-wp-rest-templates-controller.php (ligne 747) github
This filter is documented in wp-includes/post-template.php
traduction française
Ce filtre est documenté dans wp-includes/post-template.php

Paramètres

Entrée :
$template->title, $template->wp_id
Sortie :
N/A

Utilisation

Filtrer le titre avant affichage

Filtre appliqué au titre du post avant affichage.

frontend content
add_filter('the_title', 'highlight_featured_posts', 10, 2);
function highlight_featured_posts($title, $post_id) {
    if (get_post_meta($post_id, '_featured', true)) {
        $title = '⭐ ' . $title . ' ⭐';
    }
    return $title;
}

Actualités

Chargement des actualités...