post_comment_status_meta_box

Display comments status form fields.

Description

post_comment_status_meta_box( (object) $post ); 

Parameters (1)

0. $post (object)
The post.

Usage

  1. if ( !function_exists( 'post_comment_status_meta_box' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/meta-boxes.php'; 
  3.  
  4. // The post. 
  5. $post = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = post_comment_status_meta_box($post); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/meta-boxes.php  
  1. function post_comment_status_meta_box($post) { 
  2. ?> 
  3. <input name="advanced_view" type="hidden" value="1" /> 
  4. <p class="meta-options"> 
  5. <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br /> 
  6. <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php 
  7. printf( 
  8. /** translators: %s: Codex URL */ 
  9. __( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page.' ),  
  10. __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); 
  11. ?></label> 
  12. <?php 
  13. /** 
  14. * Fires at the end of the Discussion meta box on the post editing screen. 
  15. * @since 3.1.0 
  16. * @param WP_Post $post WP_Post object of the current post. 
  17. */ 
  18. ?> 
  19. </p> 
  20. <?php