WP custom post

//  Slider Custom Post 

function slider_custom_post()
{

    register_post_type(
        'sliders',
        // CPT Options
        array(
            'labels' => array(
                'name' => __('Sliders'),
                'singular_name' => __('Slider')
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'sliders'),
            'show_in_rest' => true,
            'supports'     => array('title', 'editor', 'thumbnail', 'custom-fields'),

        )
    );
}

// Hooking up our function to theme setup
add_action('init', 'slider_custom_post');