Skip to content

Instantly share code, notes, and snippets.

@n7studios
Last active September 3, 2015 15:54
Show Gist options
  • Save n7studios/ddf95a22b7dcfd2f0a8e to your computer and use it in GitHub Desktop.
Save n7studios/ddf95a22b7dcfd2f0a8e to your computer and use it in GitHub Desktop.
Soliloquy - Exclude from Search
<?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