WordPress Registering a custom post type


Example

add_action( 'init', function() {
    register_post_type( 'event', array(
            'public' => true,
            'label'  => 'Events'
        );
    );
});

Registers a new custom post type with a label Events and a slug event