averydev
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: WordPress Rest API equivalent to category__andHi there bcworkz.
I’m indeed only looking for
ANDright now. I don’t think that GET vs POST will make any difference since the same parameters are available regardless of which method, unless I’m missing some documentation somewhere.There is an upper limit to the number of characters in a get request but that’s not an issue here.
It sounds like I’m going to need to build a custom endpoint to do this. I’m surprised that there isn’t a way to do this request since it’s such a basic one…
Forum: Developing with WordPress
In reply to: WordPress Rest API equivalent to category__andHey there,
The approach of the ascending order categories doesn’t seem to have any effect, my guess is that it’s a coincidence that the sequence has an effect for you.
categories[]=5&categories[]=6&categories[]=12similarly has the effect of an “OR” rather than an “AND” in my experience.The reason that multiple requests won’t work is this — Imagine if you had 3 categories, each with 1000 posts, but only 10 posts that overlapped all 3. You wouldn’t be making 3 requests — you’d have to load all of the posts from one of the categories, and then in JS check each item to see if the categories matched.
That’d be 100x the data transfer compared to what was actually needed. It seems to me that this is something that would best be handled at the db, since it is touching all of the data.
- This reply was modified 8 years, 9 months ago by averydev.