DEV: Centralize logic for applying order to filtered posts. (PR #14634)

Instead of leaking ordering of the posts all around the class, we centralize it in a method making the code easier to understand. In a future PR, we will also introduce a plugin API to allow custom ordering and the change in this commit helps to faciliate that.


Thank you for the review @eviltrout