<?php

/**
 * Docs :: https://developer.wordpress.org/reference/functions/register_taxonomy/
 */


// Get Options
$data = flo_get_global_option_arr('fgt_options');
if (gettype($data) === 'string') {
	$data = json_decode($data, TRUE);
}

if (isset($data['galleryCategorySlug']) && strlen(trim($data['galleryCategorySlug']))) {
	$gallery_categ_permalink = $data['galleryCategorySlug'];
} else {
	$gallery_categ_permalink = 'gallery-category';
}

if (isset($data['galleryTagSlug']) && strlen(trim($data['galleryTagSlug']))) {
	$gallery_tag_permalink = $data['galleryTagSlug'];
} else {
	$gallery_tag_permalink = 'gallery-tag';
}

$taxonomies_arr = array(
	'gallery-category' => array(
		'supported_post_types' => array('gallery'),
		'taxonomy_options' => array(
			'label'  => '',
			'labels'            => array(
				'name'  => 'Categories',
				'singular_name'  => 'Category',
			),
			'description'     => '',
			'public'                => TRUE,
			'hierarchical'  => TRUE,
			//'rewrite'      => true,
			'rewrite' => array('slug' => $gallery_categ_permalink),
			'capabilities'  => array(),
			'meta_box_cb'     => NULL,
			'show_admin_column'  => TRUE,
			'show_in_rest'  => TRUE,
			'rest_base' => NULL,
		)
	),
	'gallery-tag' => array(
		'supported_post_types' => array('gallery'),
		'taxonomy_options' => array(
			'label'  => '',
			'labels'            => array(
				'name'  => 'Gallery Tags',
				'singular_name'  => 'Gallery Tag',
			),
			'description'     => '',
			'public'                => TRUE,
			'hierarchical'  => TRUE,
			//'rewrite'      => true,
			'rewrite' => array('slug' => $gallery_tag_permalink),
			'capabilities'  => array(),
			'meta_box_cb'     => NULL,
			'show_admin_column'  => TRUE,
			'show_in_rest'  => TRUE,
			'rest_base' => NULL,
		)
	)
	// 'header_cat' => array(
	//     'supported_post_types' => array( 'header' ),
	//     'taxonomy_options' => array(
	//         'label'  => '',
	//         'labels'            => array(
	//             'name'  => 'Categories',
	//             'singular_name'  => 'Category',
	//         ),
	//         'description'     => '',
	//         'public'                => true,
	//         'hierarchical'  => false,
	//         'rewrite'      => true,
	//         'capabilities'  => array(),
	//         'meta_box_cb'     => null,
	//         'show_admin_column'  => false,
	//         'show_in_rest'  => null,
	//         'rest_base' => null,
	//     )
	// )
);
