<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

use Carbon_Fields\Field\Field;
use Gigneo\Post_Types;
use Gigneo\Taxonomies;
use Gigneo\Theme_Option;

$gigneo_post_types_slug = Post_Types::post_type_slug();
$gigneo_taxonomies_slug = Taxonomies::taxonomy_slug();

//Tab Main Heading
$gigneo_slug_main_heading = Theme_Option::render_heading_markup(
	esc_html__( 'Slugs', 'gigneo' ),
	esc_html__( 'Manage and configure platform slugs.', 'gigneo' )
);

$gigneo_slug_fields[] =
	Field::make( 'html', 'gigneo_ts_slug_main_heading' )
		->set_html( $gigneo_slug_main_heading )
		->set_classes( 'gn-ts-main-heading' );

//Post Type
$gigneo_post_types_slug_heading = Theme_Option::render_heading_markup(
	esc_html__( 'Posts', 'gigneo' ),
	esc_html__( 'Define and set post-type slugs.', 'gigneo' )
);

$gigneo_slug_post_types_fields[] =
	Field::make( 'html', 'gigneo_ts_post_type_slugs' )
		->set_html( $gigneo_post_types_slug_heading )
		->set_classes( 'gn-ts-field-heading' );

$gigneo_slug_post_types_fields[] =
	Field::make( 'text', 'gigneo_ts_post_type_freelancer_slug', gigneo_freelancer_singular() )
		->set_attribute( 'placeholder', $gigneo_post_types_slug['gigneo_freelancer'] )
		->set_attribute( 'data-regex', '^[a-z_-]+$' );

$gigneo_slug_post_types_fields[] =
	Field::make( 'text', 'gigneo_ts_post_type_service_slug', esc_html__( 'Service', 'gigneo' ) )
		->set_attribute( 'placeholder', $gigneo_post_types_slug['gigneo_service'] )
		->set_attribute( 'data-regex', '^[a-z_-]+$' );

$gigneo_slug_post_types_fields[] =
	Field::make( 'text', 'gigneo_ts_post_type_employer_slug', gigneo_employer_singular() )
		->set_attribute( 'placeholder', $gigneo_post_types_slug['gigneo_employer'] )
		->set_attribute( 'data-regex', '^[a-z_-]+$' );

$gigneo_slug_post_types_fields[] =
	Field::make( 'text', 'gigneo_ts_post_type_job_slug', esc_html__( 'Job', 'gigneo' ) )
		->set_attribute( 'placeholder', $gigneo_post_types_slug['gigneo_job'] )
		->set_attribute( 'data-regex', '^[a-z_-]+$' );

$gigneo_slug_post_types_fields = apply_filters( 'gigneo_ts_slug_tab_post_type_section_fields', $gigneo_slug_post_types_fields );
$gigneo_slug_fields            = array_merge( $gigneo_slug_fields, $gigneo_slug_post_types_fields );

//Taxonomies
$gigneo_slug_taxonomy_fields[] =
	Field::make( 'html', 'gigneo_ts_slug_taxonomies_separator' )
		->set_html( '<hr/>' )
		->set_classes( 'gn-separator' );

$gigneo_slug_taxonomy_heading = Theme_Option::render_heading_markup(
	esc_html__( 'Taxonomies', 'gigneo' ),
	esc_html__( 'Define and set taxonomies slugs.', 'gigneo' )
);

$gigneo_slug_taxonomy_fields[] =
	Field::make( 'html', 'gigneo_ts_taxonomy_slugs' )
		->set_html( $gigneo_slug_taxonomy_heading )
		->set_classes( 'gn-ts-field-heading' );

$gigneo_slug_taxonomy_fields[] =
	Field::make( 'text', 'gigneo_ts_taxonomy_category_slug', esc_html__( 'Category', 'gigneo' ) )
		->set_attribute( 'placeholder', $gigneo_taxonomies_slug['gigneo_facet'] )
		->set_attribute( 'data-regex', '^[a-z_-]+$' );

$gigneo_slug_taxonomy_fields[] =
	Field::make( 'text', 'gigneo_ts_taxonomy_skill_slug', esc_html__( 'Skill', 'gigneo' ) )
		->set_attribute( 'placeholder', $gigneo_taxonomies_slug['gigneo_skill'] )
		->set_attribute( 'data-regex', '^[a-z_-]+$' );

$gigneo_slug_taxonomy_fields = apply_filters( 'gigneo_ts_slug_tab_taxonomy_section_fields', $gigneo_slug_taxonomy_fields );
$gigneo_slug_fields          = array_merge( $gigneo_slug_fields, $gigneo_slug_taxonomy_fields );
