Firstly, your problem with the last post type and/or term overwriting all previous is because ‘filter’ is a 2-dimensional array. Therefore ‘taxonomy’ (the key in this case) can only have one value. If that seems odd, read this super helpful page on the plugin’s github that helped me a lot (read this)
tldr; term lists and multi-dimensional arrays are possible with WP JSON API! you would just do type[]=post_type1&type[]=post_type2
for custom post types! Try it.
So, with that in mind… you still can’t do a multiple custom taxonomy query currently (as far as I can tell). Bummer, I know. My solution? Nest your second query within the success callback of the first, then concatenate the arrays and sort the final array.
$http.get(
$scope.api + '/posts?type=eats&filter[taxonomy]=eats-categories&filter[term]=eats-video'
).
success(function(data, status, headers, config){
$scope.posts = data;
$http.get(
$scope.api + '/posts?type=shreds&filter[taxonomy]=shreds-categories&filter[term]=shreds-video'
).
success(function(data_2, status, headers, config){
$scope.posts = $scope.posts.concat( data_2 );
}).
error(function(data_2, status, headers, config){
alert( 'video 2 widget query error' );
});
}).
error(function(data, status, headers, config){
alert( 'video widget query error' );
});
Note, this code is specific to my queries, but I tested it and it worked. I haven’t written the sort function yet, but I’ll either be sorting by the WordPress date field of the array values or using an angular filter to do something fun.
Edit: made a couple of changes for clarity.