I needed to make the array of categories separate to each other, as this is where the ‘AND’ is being applied:
/* Filter Portfolio Post Results */
function portfoliofilter_filter_function(){
$args = array(
'orderby' => 'publish_date', // we will sort posts by date
'order' => 'DESC' // ASC or DESC
);
// for taxonomies / categories
if( ( isset( $_POST['sectorfilter'] ) ) || ( isset( $_POST['categoryfilter'] ) ) )
$args['tax_query'] = array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $_POST['sectorfilter']
),
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $_POST['categoryfilter']
)
);
$query = new WP_Query( $args );
if( $query->have_posts() ) :
while( $query->have_posts() ): $query->the_post();