-
-
Save billerickson/05b9e62678489f36373b2543602a7aa7 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 | |
/** | |
* SearchWP Related on specific post types | |
* @see https://www.billerickson.net/code/searchwp-related-on-specific-post-types/ | |
*/ | |
function ea_searchwp_related_exclude( $exclude = array() ) { | |
$allowed = array( 'post', 'resource' ); | |
$all = array_keys( get_post_types() ); | |
return array_diff( $all, $allowed ); | |
} | |
add_filter( 'searchwp_related_excluded_post_types', 'ea_searchwp_related_exclude' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment