comment_class

FUNCTION wp-includes\comment-template.php (ligne 479) github
Generates semantic classes for each comment element.

Paramètres

Entrée :
$css_class = '', $comment = null, $post = null, $display = true
Sortie :
@param string|string[] $css_class Optional. One or more classes to add to the class list.
@param int|WP_Comment  $comment   Optional. Comment ID or WP_Comment object. Default current comment.
@param int|WP_Post     $post      Optional. Post ID or WP_Post object. Default current post.
@param bool            $display   Optional. Whether to print or return the output.
@return void|string Void if `$display` argument is true, comment classes if `$display` is false.

Utilisation

// Utilisation de la fonction comment_class
$result = comment_class($css_class = '', $comment = null, $post = null, $display = true);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...