Last active
September 3, 2015 15:54
-
-
Save n7studios/ddf95a22b7dcfd2f0a8e to your computer and use it in GitHub Desktop.
Soliloquy - Exclude from Search
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 | |
/** | |
* Plugin Name: Soliloquy - Exclude from Search | |
* Plugin URI: http://soliloquywp.com | |
* Version: 1.0 | |
* Author: Tim Carr | |
* Author URI: http://www.n7studios.co.uk | |
* Description: Exclude Soliloquy Sliders from Search Results | |
*/ | |
/** | |
* Exclude the Soliloquy CPT from search results | |
* | |
* @param array $args register_post_type() args | |
* @return array register_post_type() args | |
*/ | |
function soliloquy_exclude_from_search( $args ) { | |
if ( is_admin() ) { | |
return $args; | |
} | |
$args['exclude_from_search'] = true; | |
return $args; | |
} | |
add_filter( 'soliloquy_post_type_args', 'soliloquy_exclude_from_search' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment