I am using the_posts action to filter out some unwanted posts - this works fine, but the pagination after this is applied gets broken. If for example there is a page with 10 results before the_posts is applied, then after it gets applied the page displays only 6 posts for example, yet there is 100 posts in total and 20 of them should be excluded.
Pagination shows 1-10 pages when it should show 1-8.
So the question is - how to make pagination work as expected and display 10 posts per page and not to have pages with less than that.
