<?php

if (! defined('ABSPATH')) {
    exit;
} require_once __DIR__ . '/class-puffergo-base-cpt.php';
class PufferGo_Case_CPT extends PufferGo_Base_CPT
{
    public const CPT_SLUG = 'puffergo_case';

    public const TAX_SLUG = 'puffergo_case_cat';

    protected function get_module_key(): string
    {
        return 'case-study';
    }

    protected function get_config(): array
    {
        return ['module_key' => 'case-study', 'cpt_slug' => self::CPT_SLUG, 'archive_slug_option' => 'puffergo_case_slug', 'archive_slug_default' => 'case-studies', 'archive_slug_label' => __('Case Studies archive base', 'puffergo'), 'menu_icon' => 'dashicons-portfolio', 'menu_position' => 6, 'supports' => ['title', 'editor', 'thumbnail', 'excerpt'], 'has_archive' => true, 'singular' => __('Case Study', 'puffergo'), 'plural' => __('Case Studies', 'puffergo'), 'menu_label' => __('Case Studies', 'puffergo'), 'tax_slug' => self::TAX_SLUG, 'tax_singular' => __('Case Category', 'puffergo'), 'tax_plural' => __('Case Categories', 'puffergo'), 'tax_archive_slug' => 'case-category', 'tag_slug' => null, ];
    }

    protected function get_meta_fields(): array
    {
        return ['_puffergo_case_client_name' => ['type' => 'string', 'description' => __('Client Name', 'puffergo'), 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => [$this, 'auth_callback'], ], '_puffergo_case_client_country' => ['type' => 'string', 'description' => __('Client Country', 'puffergo'), 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => [$this, 'auth_callback'], ], '_puffergo_case_industry' => ['type' => 'string', 'description' => __('Industry', 'puffergo'), 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => [$this, 'auth_callback'], ], '_puffergo_case_results' => ['type' => 'string', 'description' => __('Results', 'puffergo'), 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => [$this, 'sanitize_json_field'], 'auth_callback' => [$this, 'auth_callback'], ], '_puffergo_case_client_logo' => ['type' => 'integer', 'description' => __('Client Logo', 'puffergo'), 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'absint', 'auth_callback' => [$this, 'auth_callback'], ], '_puffergo_case_products' => ['type' => 'string', 'description' => __('Related Product IDs (JSON: [id,...])', 'puffergo'), 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => [$this, 'sanitize_json_field'], 'auth_callback' => [$this, 'auth_callback'], ], ];
    }
}
