<?php
/**
 * Post_Type_Resort Class
 *
 * @package dvcrs-core
 */

namespace DVCRS\Core;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Post_Type_Resort Class
 */
class Post_Type_Resort {

	/**
	 * Post_Type_Resort constuctor
	 */
	public function __construct() {

		\add_action( 'init', [ $this, 'register_post_type' ], 1 );

	}

	/**
	 * Registers the custom post type
	 */
	public function register_post_type() {

		$labels = [
			'name'                  => _x( 'Resorts', 'Post Type General Name', 'dvcrs-core' ),
			'singular_name'         => _x( 'Resort', 'Post Type Singular Name', 'dvcrs-core' ),
			'menu_name'             => __( 'Resorts', 'dvcrs-core' ),
			'name_admin_bar'        => __( 'Resort', 'dvcrs-core' ),
			'archives'              => __( 'Resort Archives', 'dvcrs-core' ),
			'attributes'            => __( 'Resort Attributes', 'dvcrs-core' ),
			'parent_item_colon'     => __( 'Parent Resort:', 'dvcrs-core' ),
			'all_items'             => __( 'All Resorts', 'dvcrs-core' ),
			'add_new_item'          => __( 'Add New Resort', 'dvcrs-core' ),
			'add_new'               => __( 'Add New', 'dvcrs-core' ),
			'new_item'              => __( 'New Resort', 'dvcrs-core' ),
			'edit_item'             => __( 'Edit Resort', 'dvcrs-core' ),
			'update_item'           => __( 'Update Resort', 'dvcrs-core' ),
			'view_item'             => __( 'View Resort', 'dvcrs-core' ),
			'view_items'            => __( 'View Resorts', 'dvcrs-core' ),
			'search_items'          => __( 'Search Resorts', 'dvcrs-core' ),
			'not_found'             => __( 'Not found', 'dvcrs-core' ),
			'not_found_in_trash'    => __( 'Not found in Trash', 'dvcrs-core' ),
			'featured_image'        => __( 'Featured Image', 'dvcrs-core' ),
			'set_featured_image'    => __( 'Set featured image', 'dvcrs-core' ),
			'remove_featured_image' => __( 'Remove featured image', 'dvcrs-core' ),
			'use_featured_image'    => __( 'Use as featured image', 'dvcrs-core' ),
			'insert_into_item'      => __( 'Add to Resort', 'dvcrs-core' ),
			'uploaded_to_this_item' => __( 'Uploaded to this Resort', 'dvcrs-core' ),
			'items_list'            => __( 'Resort list', 'dvcrs-core' ),
			'items_list_navigation' => __( 'Resort list navigation', 'dvcrs-core' ),
			'filter_items_list'     => __( 'Filter Resort list', 'dvcrs-core' ),
		];
		$args   = [
			'label'              => __( 'Resorts', 'dvcrs-core' ),
			'description'        => __( 'Resorts at DVC Rental Store', 'dvcrs-core' ),
			'labels'             => $labels,
			'supports'           => [ 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' ],
			'hierarchical'       => true,
			'menu_icon'          => 'dashicons-palmtree',
			'public'             => true,
			'show_in_rest'       => true,
			'has_archive'        => true,
			'has_post_type_page' => true,
		];

		register_post_type( 'resort', $args );
	}
}

new Post_Type_Resort();
