shortcode and custom taxonomy wordpress
add_shortcode('list_portfolios', function ($atts) {
$atts = shortcode_atts(
array(
'slug' => '',
), $atts, 'list_portfolios');
$args = [
'post_type' => 'portfolio',
'tax_query' => array(
array(
'taxonomy' => 'danh-muc-san-pham',
'field' => 'slug',
'terms' => $atts['slug'],
)
),
];
$query = new WP_Query($args);
});