Thanks,
My custom post type was in a plugin and I was also running this code:
if ( ! function_exists('disable_plugins_when_wp_search_suggest') ) {
add_filter( 'option_active_plugins', 'disable_plugins_when_wp_search_suggest' );
function disable_plugins_when_wp_search_suggest( $active_plugins ) {
$uri = 'action=wp-search-suggest';
$action = 'wpss-post-url';
if ( false !== strpos( $_SERVER['REQUEST_URI'], $uri) || isset($_POST['action']) && $_POST['action'] == $action ) {
$for_enable = 'wp-search-suggest/wp-search-suggest.php';
$index = array_search($for_enable, $active_plugins);
foreach( $active_plugins as $idx => $plugin ) {
if ( $index !== array_search( $plugin, $active_plugins) ) {
unset($active_plugins[$idx]);
}
}
}
return $active_plugins;
}
}
So as you can see it disables all plugins when running search query, I will probably just include the custom post type code in my theme instead, thanks.