wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_create_initial_comment_meta › WordPress Function

Since6.9.0
已弃用n/a
› wp_create_initial_comment_meta ( 没有参数 )
定义在:
文档:

Register initial note status meta.



源码

function wp_create_initial_comment_meta() {
	register_meta(
		'comment',
		'_wp_note_status',
		array(
			'type'          => 'string',
			'description'   => __( 'Note resolution status' ),
			'single'        => true,
			'show_in_rest'  => array(
				'schema' => array(
					'type' => 'string',
					'enum' => array( 'resolved', 'reopen' ),
				),
			),
			'auth_callback' => function ( $allowed, $meta_key, $object_id ) {
				return current_user_can( 'edit_comment', $object_id );
			},
		)
	);
}