comments_open

FUNCTION wp-includes\comment-template.php (ligne 1299) github
Determines whether the current post is open for comments. For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.

Paramètres

Entrée :
$post = null
Sortie :
@param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
@return bool True if the comments are open.

Utilisation

// Utilisation de la fonction comments_open
$result = comments_open($post = null);

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

Actualités

Chargement des actualités...