<?php

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

use Carbon_Fields\Field\Field;
use Gigneo\Modules;
use Gigneo\Post_Meta\Serialized;

$gigneo_location_fields[] =
	Field::make( 'select', 'gigneo_pm_country_state', esc_html__( 'Country / State', 'gigneo' ) )
		->set_options( gigneo_countries_with_states( 'active' ) )
		->set_classes( 'gn-select2' );

$gigneo_cities_option = gigneo_option( '_gigneo_ts_disable_cities', false );

if ( ! $gigneo_cities_option ) {
	$gigneo_location_fields[] =
		Field::make( 'select', 'gigneo_pm_city', esc_html__( 'City', 'gigneo' ) )
			->set_options( gigneo_cities() )
			->set_classes( 'gn-select2' );
}

$gigneo_location_fields[] =
	Field::make( 'text', 'gigneo_pm_area', esc_html__( 'Area', 'gigneo' ) )
		->set_attribute( 'placeholder', esc_html__( 'Block / Sector / Town', 'gigneo' ) );

$gigneo_location_fields[] =
	Field::make( 'text', 'gigneo_pm_zip_code', esc_html__( 'Postcode / ZIP', 'gigneo' ) )
		->set_classes( $gigneo_cities_option ? 'gn-pm-field-full' : '' );



$gigneo_location_fields[] =
	Field::make( 'textarea', 'gigneo_pm_friendly_address', esc_html__( 'Address', 'gigneo' ) )
		->set_classes( 'gn-pm-field-full' );

$gigneo_location_fields = apply_filters( 'gigneo_pm_job_location_fields', $gigneo_location_fields );
