Come registrare un custom post type in WordPress

php function.php
/* Aggiungo in post type denominandolo projects */

add_action( 'init', function() {
    register_post_type( 'projects', [
        'label'  => 'Progetti',
        'public' => true,
    ]);
});