post_comment_status_meta_box() - WordPress 函数参考中文文档

返回介绍

post_comment_status_meta_box()

发布于 2017-09-11 字数2294 浏览 841 评论 0

post_comment_status_meta_box( object $post )

Display comments status form fields.


描述


参数

$post

(object)
(Required)


源代码

File: wp-admin/includes/meta-boxes.php

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
}

更新日志

Version 描述
2.6.0 Introduced.

相关函数

Uses

  • wp-admin/includes/meta-boxes.php:
    post_comment_status_meta_box-options
  • wp-includes/l10n.php:
    _e()
  • wp-includes/l10n.php:
    __()
  • wp-includes/general-template.php:
    checked()
  • wp-includes/plugin.php:
    do_action()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!