<?php
/**
 * Custom post types.
 *
 * @package ALFASMART
 */

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

add_action('init', function () {
    register_post_type('companies', array(
        'labels' => array(
            'name'               => __('Companies', 'alfasmart'),
            'singular_name'      => __('Company', 'alfasmart'),
            'add_new_item'       => __('Add New Company', 'alfasmart'),
            'edit_item'          => __('Edit Company', 'alfasmart'),
            'all_items'          => __('All Companies', 'alfasmart'),
            'not_found'          => __('No companies found.', 'alfasmart'),
        ),
        'public'       => true,
        'has_archive'  => true,
        'menu_icon'    => 'dashicons-building',
        'menu_position'=> 5,
        'supports'     => array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes'),
        'rewrite'      => array('slug' => 'companies'),
        'show_in_rest' => true,
        'show_in_nav_menus' => true,
    ));

    register_post_type('services', array(
        'labels' => array(
            'name'               => __('Services', 'alfasmart'),
            'singular_name'      => __('Service', 'alfasmart'),
            'add_new_item'       => __('Add New Service', 'alfasmart'),
            'edit_item'          => __('Edit Service', 'alfasmart'),
            'all_items'          => __('All Services', 'alfasmart'),
            'not_found'          => __('No services found.', 'alfasmart'),
        ),
        'public'       => true,
        'has_archive'  => true,
        'menu_icon'    => 'dashicons-chart-line',
        'menu_position'=> 6,
        'supports'     => array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes'),
        'rewrite'      => array('slug' => 'services'),
        'show_in_rest' => true,
        'show_in_nav_menus' => true,
    ));
});
