Skip to:
Content

BuddyPress.org

Ticket #4154: 4154.diff

File 4154.diff, 1.7 KB (added by ericlewis, 8 years ago)

Cleaned up Invinco's implementation a bit; added respect for custom title in bp_modify_page_title

  • bp-core/bp-core-filters.php

     
    271271        if ( is_front_page() || is_home() )
    272272                return $title;
    273273
     274        // If this is the search page of the site, return WP's title
     275        if ( is_search() )
     276                return $title;
     277
    274278        $title = '';
    275279
    276280        // Displayed user
  • bp-core/bp-core-functions.php

     
    606606 * @param string $slug The slug to redirect to for searching.
    607607 */
    608608function bp_core_action_search_site( $slug = '' ) {
     609        global $bp;
    609610
    610611        if ( !bp_is_current_component( bp_get_search_slug() ) )
    611612                return;
    612 
    613         if ( empty( $_POST['search-terms'] ) ) {
     613       
     614        if ( empty( $_POST['search-terms'] ) && count( $bp->unfiltered_uri ) == 1 ) {
    614615                bp_core_redirect( bp_get_root_domain() );
    615616                return;
    616617        }
    617618
     619        // To allow for pretty search URLs e.g. /search/term/
     620        if(count($bp->unfiltered_uri) > 1 )
     621                return;
     622
    618623        $search_terms = stripslashes( $_POST['search-terms'] );
    619624        $search_which = !empty( $_POST['search-which'] ) ? $_POST['search-which'] : '';
    620625        $query_string = '/?s=';
  • bp-core/bp-core-catchuri.php

     
    427427        if ( !empty( $bp->no_status_set ) )
    428428                return false;
    429429
     430        // If is_search() is set pass through to native WP search
     431        if ( is_search() )
     432                return false;
     433
    430434        if ( !isset( $wp_query->queried_object ) && !bp_is_blog_page() ) {
    431435                bp_do_404();
    432436        }