A look at the posts_where filter in WordPress
The WP_Query class in WordPress is extremely robust and allows you to construct just about any kind of query you need for retrieving data from the wp_posts table, but there are still scenarios you will encounter when building your plugins that WP_Query doesn’t support. Before WordPress 3.7, the posts_where filter was used primarily for setting up date-range queries and…