<?php
namespace OxygenApp\Hooks;
if ( ! defined( 'ABSPATH' ) ) exit;

use OxygenApp\Models\BackgroundSound;
use OxygenApp\Models\Background;
use OxygenApp\Hooks\IHook;
class ActionRegisterCpt implements IHook {

    static function register() {
        add_action('init', [self::class, 'registerCpts']);
    }

    public static function registerCpts() {
        self::registerBackgroundSoundsCpt();
        self::registerBackgroundCpt();
    }

    private static function registerBackgroundSoundsCpt() {
        $args = [
            'labels' => [
                'name'                  => __('Background Sounds', 'oxyleaf-app-working-and-relaxing-app'),
                'singular_name'         => __('Background Sound', 'oxyleaf-app-working-and-relaxing-app'),
                'add_new'               => __('Add New', 'oxyleaf-app-working-and-relaxing-app'),
                'add_new_item'          => __('Add New Background Sound', 'oxyleaf-app-working-and-relaxing-app'),
                'edit_item'             => __('Edit Background Sound', 'oxyleaf-app-working-and-relaxing-app'),
                'new_item'              => __('New Background Sound', 'oxyleaf-app-working-and-relaxing-app'),
                'view_item'             => __('View Background Sound', 'oxyleaf-app-working-and-relaxing-app'),
                'search_items'          => __('Search Background Sounds', 'oxyleaf-app-working-and-relaxing-app'),
                'not_found'             => __('No background sounds found', 'oxyleaf-app-working-and-relaxing-app'),
                'not_found_in_trash'    => __('No background sounds found in Trash', 'oxyleaf-app-working-and-relaxing-app'),
                'all_items'             => __('All Background Sounds', 'oxyleaf-app-working-and-relaxing-app'),
                'menu_name'             => __('Background Sounds', 'oxyleaf-app-working-and-relaxing-app'),
            ],
            'public'               => false,
            'publicly_queryable'   => false,
            'show_ui'              => true,
            'show_in_menu'         => true,
            'query_var'            => true,
            'rewrite'              => ['slug' => 'oxygen-app-background-sound'],
            'has_archive'          => false,
            'hierarchical'         => false,
            'menu_position'        => 81,
            'supports'             => ['title'],
        ];

        register_post_type(BackgroundSound::POST_TYPE, $args);
    }

    private static function registerBackgroundCpt() {
        $args = [
            'labels' => [
                'name'                  => __('Backgrounds', 'oxyleaf-app-working-and-relaxing-app'),
                'singular_name'         => __('Background', 'oxyleaf-app-working-and-relaxing-app'),
                'add_new'               => __('Add New', 'oxyleaf-app-working-and-relaxing-app'),
                'add_new_item'          => __('Add New Background', 'oxyleaf-app-working-and-relaxing-app'),
                'edit_item'             => __('Edit Background', 'oxyleaf-app-working-and-relaxing-app'),
                'new_item'              => __('New Background', 'oxyleaf-app-working-and-relaxing-app'),
                'view_item'             => __('View Background', 'oxyleaf-app-working-and-relaxing-app'),
                'search_items'          => __('Search Backgrounds', 'oxyleaf-app-working-and-relaxing-app'),
                'not_found'             => __('No background found', 'oxyleaf-app-working-and-relaxing-app'),
                'not_found_in_trash'    => __('No background found in Trash', 'oxyleaf-app-working-and-relaxing-app'),
                'all_items'             => __('All Backgrounds', 'oxyleaf-app-working-and-relaxing-app'),
                'menu_name'             => __('Backgrounds', 'oxyleaf-app-working-and-relaxing-app'),
            ],
            'public'               => false,
            'publicly_queryable'   => false,
            'show_ui'              => true,
            'show_in_menu'         => true,
            'query_var'            => true,
            'rewrite'              => ['slug' => 'oxygen-app-background'],
            'has_archive'          => false,
            'hierarchical'         => false,
            'menu_position'        => 82,
            'supports'             => ['title'],
        ];

        register_post_type(Background::POST_TYPE, $args);
    }
}