Created
March 28, 2016 16:25
-
-
Save ajaydsouza/75923b42aa0f0cdcb197 to your computer and use it in GitHub Desktop.
CRP - Limit to same post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the post types to limit it to the same post type. | |
* | |
* @param array $post_types Array of post types included in WHERE clause | |
* @return array Updated array of post types | |
*/ | |
function crp_same_post_type( $post_types ) { | |
global $post; | |
$post_types = array( | |
$post->post_type => $post->post_type | |
); | |
return $post_types; | |
} | |
add_filter( 'crp_posts_post_types', 'crp_same_post_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment