Yes, you’re on the right track. If the four taxonomies you mention are the slugs with which the taxonomies are registered, then you need to use those as the taxonomy
parameters and the terms passed with them as the terms
parameters for the different tax_query
arrays.
You’ll also need to put the tax parameters to the shortcode_atts
default array to have them available on the $a
variable.
$a = shortcode_atts( array(
'cpt' => '',
'language' => '',
'document_category' => '',
'media_industry' => '',
'product_line' => '', // add default values to these if needed or set defaults as in the example below
), $atts );
The different taxonomies could also be optional,
if ( $a['language'] ) {
$args['tax_query'][] = array(
'taxonomy' => 'media_language',
'field' => 'slug',
'terms' => $a['language'],
);
}
Set default value, if not set with shortcode_atts()
$args['tax_query'] = array(
array(
'taxonomy' => 'media_language',
'field' => 'slug',
'terms' => ! empty($a['language']) ? $a['language'] : 'some-default-term',
),
// more taxonomies...
);
I think 'relation' => 'AND'
is the default, so you might not need to explicitly declare it.