<?php

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

	public function __construct() {
		add_action('init', [$this, 'register_story_cpt']);
	}

	public function register_story_cpt() {
		$labels = [
			'name'               => esc_html__( 'StoryPosts', 'storyposts' ),
			'singular_name'      => esc_html__( 'Story', 'storyposts' ),
			'menu_name'          => esc_html__( 'StoryPosts', 'storyposts' ),
			'name_admin_bar'     => esc_html__( 'Story', 'storyposts' ),
			'add_new'            => esc_html__( 'Add New', 'storyposts' ),
			'add_new_item'       => esc_html__( 'Add New Story', 'storyposts' ),
			'new_item'           => esc_html__( 'New Story', 'storyposts' ),
			'edit_item'          => esc_html__( 'Edit Story', 'storyposts' ),
			'view_item'          => esc_html__( 'View Story', 'storyposts' ),
			'all_items'          => esc_html__( 'All Stories', 'storyposts' ),
			'search_items'       => esc_html__( 'Search Stories', 'storyposts' ),
			'not_found'          => esc_html__( 'No stories found.', 'storyposts' ),
			'not_found_in_trash' => esc_html__( 'No stories in trash.', 'storyposts' ),
		];

		$args = [
			'labels'              => $labels,
			'public'              => false,  // Not publicly accessible
			'publicly_queryable'  => false,  // No frontend URLs
			'show_ui'             => true,
			'show_in_menu'        => true,
			'show_in_nav_menus'   => false,  // Hidden from Appearance > Menus
			'menu_position'       => 26,
			'menu_icon'           => 'dashicons-format-status',
			'capability_type'     => 'post',
			'supports'            => ['title'],
			'has_archive'         => false,
			'exclude_from_search' => true,
		];

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