<?php
/**
 * Template part for displaying the job taxonomy filters block
 *
 * @link        https://matadorjobs.com/
 *
 * @since       3.90
 *
 * @package     Matador Jobs
 * @subpackage  Blocks
 * @author      Matador Software LLC, Jeremy Scott, Paul Bearne
 * @copyright   (c) 2017-2025, Matador Software, LLC
 *
 * @license     https://opensource.org/licenses/GPL-3.0 GNU General Public License version 3
 */

$chosen_taxonomy = isset( $attributes['chosenTaxonomy'] ) ? $attributes['chosenTaxonomy'] : null;

$label = isset( $attributes['label'] ) ? $attributes['label'] : '';

$as = isset( $attributes['displayAs'] ) ? $attributes['displayAs'] : 'list';

$method = isset( $attributes['method'] ) ? $attributes['method'] : 'link';

$show_all = isset( $attributes['showAll'] ) ? $attributes['showAll'] : true;

$tax_orderby = isset( $attributes['orderBy'] ) ? $attributes['orderBy'] : 'name';

$hide_empty = isset( $attributes['hideEmpty'] ) ? $attributes['hideEmpty'] : true;

$atts = shortcode_atts(
	[
		'taxonomy'        => $chosen_taxonomy,
		'label'           => $label,
		'as'              => $as,
		'method'          => $method,
		'show_all_option' => $show_all,
		'orderby'         => $tax_orderby,
		'hide_empty'      => $hide_empty,
		'class'           => null,
	],
	[]
);

$wrapper_attributes = get_block_wrapper_attributes();

printf(
	'<div %1$s >%2$s</div>',
	$wrapper_attributes,
	matador_taxonomy( $atts )
);
