I see that there are hooks for manipulating WP_Query before it gets its posts (parse_query, pre_get_posts), but I can’t seem to find any hooks for after the WP_Query object is populated. I have a custom table for my plugin-specific post-associated meta data that I would like to fetch from after a WP_Query object is populated.
Leave a Reply
You must be logged in to post a comment.
As you haven’t stated what you are trying to achieve and have just mentioned you need to fetch associated data. You have two options to query your custom table:
The example below demonstrates first method.
For the second method you will need to look at posts_where, posts_join, posts_groupby and posts_orderby filters. As an example you can have a look at the @scribu’s sortable custom column’s example.
Try with publish_post, save_post or wp_insert_post
read more here