<?php

/**
 * Register Movies custom post type
 *
 * @link       http://example.com
 * @since      1.0.0
 *
 * @package    Movies
 * @subpackage Movies/includes
 */

/**
 * Register Movies custom post type.
 *
 * @package    Movies
 * @subpackage Movies/includes
 * @author     Your Name <email@example.com>
 */
class Movies_Post_Type {

    public function __construct() {
        add_action( 'init', array( $this, 'register_post_type' ) );
    }

    public function register_post_type() {
        $labels = array(
            'name'               => __( 'Movies', 'movies' ),
            'singular_name'      => __( 'Movie', 'movies' ),
            'menu_name'          => __( 'Movies', 'movies' ),
            'name_admin_bar'     => __( 'Movie', 'movies' ),
            'add_new'            => __( 'Add New', 'movies' ),
            'add_new_item'       => __( 'Add New Movie', 'movies' ),
            'new_item'           => __( 'New Movie', 'movies' ),
            'edit_item'          => __( 'Edit Movie', 'movies' ),
            'view_item'          => __( 'View Movie', 'movies' ),
            'all_items'          => __( 'All Movies', 'movies' ),
            'search_items'       => __( 'Search Movies', 'movies' ),
            'parent_item_colon'  => __( 'Parent Movie:', 'movies' ),
            'not_found'          => __( 'No movies found.', 'movies' ),
            'not_found_in_trash' => __( 'No movies found in Trash.', 'movies' ),
        );

        $args = array(
            'labels'             => $labels,
            'description'        => __( 'Description.', 'movies' ),
            'public'             => true,
            'publicly_queryable' => true,
            'show_ui'            => true,
            'show_in_menu'       => true,
            'query_var'          => true,
            'rewrite'            => array( 'slug' => 'movies' ),
            'capability_type'    => 'post',
            'has_archive'        => true,
            'hierarchical'       => false,
            'menu_position'      => null,
            'supports'           => array( 'title', 'editor', 'thumbnail', 'excerpt', 'custom-fields' ),
            'rest_base'          => 'movies',
        );

        register_post_type( 'movies', $args );
    }
}
new Movies_Post_Type();

