Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search for multiple full-width words including full-width spaces


  • shimdayo
    Participant

    @shim1506

    I use bbpress in Japanese.

    In the bbpress search window, if you search for two or more words with double-byte spaces, no search results will appear.

    I tried replacing half-width with full-width, and it worked in the wordpress search window, but not in the bbpress search window.

    advice please.
    thank you.

    function empty_search( $query ) {
        if ( $query->is_main_query() && $query->is_search && ! $query->is_admin ) {
        $s = $query->get( 's' );
        $s = str_replace(' ',' ', $s );
        $query->set( 's', $s );
        }
    }
    add_action( 'pre_get_posts', 'empty_search' );
  • You must be logged in to reply to this topic.
Skip to toolbar