Created
August 19, 2019 14:31
-
-
Save neverything/abdb3ea4cd4d75e50bbb1b588e4d8779 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Hide CPT from Search | |
*/ | |
function update_my_custom_type() { | |
global $wp_post_types; | |
if ( post_type_exists( 'wpm-testimonail' ) ) { | |
// exclude from search results | |
$wp_post_types['wpm-testimonail']->exclude_from_search = true; | |
} | |
} | |
add_action( 'init', 'update_my_custom_type', 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment