$args ) { register_post_meta( $post_type, $meta_key, array_merge( $args, array( 'show_in_rest' => true, 'auth_callback' => static function ( bool $allowed, string $meta_key, int $post_id ): bool { return current_user_can( 'edit_post', $post_id ); }, ) ) ); } } } }