<?php
namespace RespacioHouzezImport;
class cpt{

    public static function configure(){

        if ( ! post_type_exists( 'property_log' ) ){
            // Labels for the custom post type
            $labels = array(
                'name'               => __( 'Property Logs', 'respacio-houzez-import' ),
                'singular_name'      => __( 'Property Log', 'respacio-houzez-import' ),
                'add_new'            => __( 'Add New', 'respacio-houzez-import' ),
                'add_new_item'       => __( 'Add New Property Log', 'respacio-houzez-import' ),
                'edit_item'          => __( 'Edit Property Log', 'respacio-houzez-import' ),
                'new_item'           => __( 'New Property Log', 'respacio-houzez-import' ),
                'view_item'          => __( 'View Property Log', 'respacio-houzez-import' ),
                'search_items'       => __( 'Search Property Logs', 'respacio-houzez-import' ),
                'not_found'          => __( 'No property logs found', 'respacio-houzez-import' ),
                'not_found_in_trash' => __( 'No property logs found in Trash', 'respacio-houzez-import' ),
                'parent_item_colon'  => __( 'Parent Property Log:', 'respacio-houzez-import' ),
                'menu_name'          => __( 'Property Logs', 'respacio-houzez-import' ),
            );

            // Arguments for registering the custom post type
            $args = array(
                'labels'              => $labels,
                'public'              => true,
                'publicly_queryable'  => true,
                'show_ui'             => true,
                'show_in_menu'        => true,
                'query_var'           => true,
                'rewrite'             => array( 'slug' => 'property-log' ), // Custom slug
                'capability_type'     => 'post',
                'has_archive'         => true,
                'hierarchical'        => false,
                'menu_position'       => null,
                'supports'            => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
            );

            // Register the custom post type
            add_action('init',function() use ($args){
                register_post_type( 'property_log', $args );
            });

        }

        if(!post_type_exists('respacio_forms')){
            // Labels for the custom post type
            $labels = array(
                'name'               => __( 'Respacio forms', 'respacio-houzez-import' ),
                'singular_name'      => __( 'Respacio form', 'respacio-houzez-import' ),
                'add_new'            => __( 'Add New', 'respacio-houzez-import' ),
                'add_new_item'       => __( 'Add New Property Log', 'respacio-houzez-import' ),
                'edit_item'          => __( 'Edit Respacio form ', 'respacio-houzez-import' ),
                'new_item'           => __( 'New Respacio form', 'respacio-houzez-import' ),
                'view_item'          => __( 'View Respacio form', 'respacio-houzez-import' ),
                'search_items'       => __( 'Search Respacio forms', 'respacio-houzez-import' ),
                'not_found'          => __( 'No respacio forms found', 'respacio-houzez-import' ),
                'not_found_in_trash' => __( 'No respacio forms found in Trash', 'respacio-houzez-import' ),
                'parent_item_colon'  => __( 'Parent Respacio Form', 'respacio-houzez-import' ),
                'menu_name'          => __( 'Respacio Forms', 'respacio-houzez-import' ),
            );

            // Arguments for registering the custom post type
            $args = array(
                'labels'              => $labels,
                'public'              => true,
                'publicly_queryable'  => true,
                'show_ui'             => true,
                'show_in_menu'        => true,
                'query_var'           => true,
                'rewrite'             => array( 'slug' => 'respacio-form' ), // Custom slug
                'capability_type'     => 'post',
                'has_archive'         => true,
                'hierarchical'        => false,
                'menu_position'       => null,
                'supports'            => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
            );

            // Register the custom post type
            add_action('init',function() use ($args){
                register_post_type( 'respacio_forms', $args );
            });
        }
    }
}