wp_create_initial_comment_meta()
Register initial note status meta.
No Hooks.
Returns
null. Nothing (null).
Usage
wp_create_initial_comment_meta();
Changelog
| Since 6.9.0 | Introduced. |
wp_create_initial_comment_meta() wp create initial comment meta code WP 6.9.1
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 );
},
)
);
}