WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I took a look at the WP_Query->get_posts() function and couldn't see any action/filter that is called AFTER a query finishes.

I want to be able to manipulate the results once they are sent, rather than the query itself (Using a Human Name Parser to sort by last name).

I'm revamping an old site that alters the global $wp_query->posts right within archive.php, so I was just wondering if there was a way to take this logic completely out of the archive file and store it with my other CPT functionality.


share|improve this question
up vote 3 down vote accepted

The is the the_posts filter, which sounds like what you want.

function filter_the_posts($posts) {
share|improve this answer
Perfect! I saw the_post, I think I must have been a little too far down in the caching area :). Cheers! – Eric Holmes Jul 5 '13 at 14:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.