I think we need to sort the post__in array based on order . I mean if order is desc then we have to sort post__in in reverse order and when order is asc , we have to sort post__in in normal order. So if include=5,2,1&orderby=include or include=5,2,1&orderby=include&order=desc is passed then result should be [ { id: 5...}, { id: 2...}, { id: 1... } ] and when include=5,2,1&orderby=include&order=asc is passed then result should be [ { id: 1...}, { id: 2...}, { id: 5... } ] . Let me know if it is correct.
|