wp_create_initial_comment_meta() │ WP 6.9.0

Register initial note status meta.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wp_create_initial_comment_meta();

Список изменений

С версии 6.9.0 Введена.

Код wp_create_initial_comment_meta() WP 7.1.2

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 );
			},
		)
	);
}