Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




comments_open [ WordPress Function ]

comments_open ( $post_id = null )
Parameters:
  • (int) $post_id An optional post ID to check instead of the current post.
Uses:
  • $post
Returns:
  • (bool) True if the comments are open
Defined at:



Whether the current post is open for comments.

Source


<?php
function comments_open$post_id null ) {

    
$_post get_post($post_id);

    
$open = ( 'open' == $_post->comment_status );
    return 
apply_filters'comments_open'$open$post_id );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics