post_comment_status_meta_box

The timeline below displays how wordpress function post_comment_status_meta_box has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Displays comments status form fields.
 *
 * @since 2.6.0
 *
 * @param WP_Post $post Current post object.
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> />
		<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('Allow <a href="%s">trackbacks and pingbacks</a>'),
        __('https://wordpress.org/documentation/article/introduction-to-blogging/#managing-comments')
    );
    ?>
	</label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object for the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    ?>
</p>
	<?php 
}

WordPress Version: 6.1

/**
 * Displays comments status form fields.
 *
 * @since 2.6.0
 *
 * @param WP_Post $post Current post object.
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> />
		<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('Allow <a href="%s">trackbacks and pingbacks</a> on this page'),
        __('https://wordpress.org/support/article/introduction-to-blogging/#managing-comments')
    );
    ?>
	</label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object for the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    ?>
</p>
	<?php 
}

WordPress Version: 5.6

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param WP_Post $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> />
		<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('Allow <a href="%s">trackbacks and pingbacks</a> on this page'),
        __('https://wordpress.org/support/article/introduction-to-blogging/#managing-comments')
    );
    ?>
	</label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    ?>
</p>
	<?php 
}

WordPress Version: 5.3

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> />
		<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('Allow <a href="%s">trackbacks and pingbacks</a> on this page'),
        __('https://wordpress.org/support/article/introduction-to-blogging/#managing-comments')
    );
    ?>
	</label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    ?>
</p>
	<?php 
}

WordPress Version: 5.1

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> />
		<?php 
    printf(
        /* translators: %s: Codex URL */
        __('Allow <a href="%s">trackbacks and pingbacks</a> on this page'),
        __('https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments')
    );
    ?>
	</label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    ?>
</p>
	<?php 
}

WordPress Version: 4.8

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> /> <?php 
    printf(
        /* translators: %s: Codex URL */
        __('Allow <a href="%s">trackbacks and pingbacks</a> on this page'),
        __('https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments')
    );
    ?></label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    ?>
</p>
<?php 
}

WordPress Version: 4.5

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> /> <?php 
    printf(
        /* translators: %s: Codex URL */
        __('Allow <a href="%s">trackbacks and pingbacks</a> on this page.'),
        __('https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments')
    );
    ?></label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    ?>
</p>
<?php 
}

WordPress Version: 4.2

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> /> <?php 
    printf(__('Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.'), __('https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments'));
    ?></label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    ?>
</p>
<?php 
}

WordPress Version: 3.9

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> /> <?php 
    printf(__('Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.'), __('http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments'));
    ?></label>
	<?php 
    /**
     * Fires at the end of the Discussion meta box on the post editing screen.
     *
     * @since 3.1.0
     *
     * @param WP_Post $post WP_Post object of the current post.
     */
    do_action('post_comment_status_meta_box-options', $post);
    ?>
</p>
<?php 
}

WordPress Version: 3.7

/**
 * Display comments status form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_comment_status_meta_box($post)
{
    ?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<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 />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php 
    checked($post->ping_status, 'open');
    ?> /> <?php 
    printf(__('Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.'), __('http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments'));
    ?></label>
	<?php 
    do_action('post_comment_status_meta_box-options', $post);
    ?>
</p>
<?php 
}