Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cases_restrict_query_to_allowed_post_ids( $where, $query ) {
- global $wpdb;
- if ( 'cases' != $query->get( 'post_type' ) )
- return $where;
- $posts = array( ... );
- $where .= " AND $wpdb->posts.ID IN (" . implode( ',', $posts ) . ")";
- return $where;
- }
- add_filter( 'posts_where', 'cases_restrict_query_to_allowed_post_ids', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement