• Resolved Lukasz

    (@wpfed)


    Or are modifications needed? So far there is no auto-suggest for any of my custom post types.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Konstantin Obenland

    (@obenland)

    Yes, there are. Out of the box, the plugin uses WP_Query‘s default.
    But you can use the wpss_search_query_args filter to specify the post types to search through:
    https://plugins.trac.www.ads-software.com/browser/wp-search-suggest/tags/4/wp-search-suggest.php#L111

    Konstantin

    Thread Starter Lukasz

    (@wpfed)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Does this search custom post types by default?’ is closed to new replies.