Skip to:
Content

BuddyPress.org

Changeset 4172


Ignore:
Timestamp:
04/07/2011 08:07:24 PM (14 years ago)
Author:
djpaul
Message:

Add search posts option into the header search box. Fixes #2255, props PedroMiguel and sorich87.
Also fixes search handling which was broken.

Location:
trunk/bp-core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-catchuri.php

    r4112 r4172  
    187187           
    188188            // Force BP to recognize that this is a members page
    189             $matches[]  = 1;
    190             $match      = $bp->pages->members;
    191             $match->key = 'members';
     189            $matches[]  = 1;
     190            $match      = $bp->pages->members;
     191            $match->key = 'members';
    192192           
    193193            // Without the 'members' URL chunk, WordPress won't know which page to load
     
    200200
    201201    // Search doesn't have an associated page, so we check for it separately
    202     if ( !empty( $bp_uri[0] ) && ( BP_SEARCH_SLUG == $bp_uri[0] ) )
    203         $matches[] = 1;
     202    if ( !empty( $bp_uri[0] ) && ( BP_SEARCH_SLUG == $bp_uri[0] ) ) {
     203        $matches[]   = 1;
     204        $match       = new stdClass;
     205        $match->key  = 'search';
     206        $match->slug = BP_SEARCH_SLUG;
     207    }
    204208
    205209    // This is not a BuddyPress page, so just return.
  • trunk/bp-core/bp-core-functions.php

    r4141 r4172  
    522522    if ( empty( $slug ) ) {
    523523        switch ( $search_which ) {
     524            case 'posts':
     525                $slug = '';
     526                $var  = '/?s=';
     527                break;
     528
    524529            case 'blogs':
    525530                $slug = bp_is_active( 'blogs' )  ? $bp->blogs->root_slug  : '';
     
    541546        }
    542547
    543         if ( empty( $slug ) ) {
     548        if ( empty( $slug ) && 'posts' != $search_which ) {
    544549            bp_core_redirect( bp_get_root_domain() );
    545550            return;
  • trunk/bp-core/bp-core-template.php

    r4107 r4172  
    337337    if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && !bp_forum_directory_is_disabled() )
    338338        $options['forums']  = __( 'Forums',  'buddypress' );
     339
     340    $options['posts'] = __( 'Posts', 'buddypress' );
    339341
    340342    // Eventually this won't be needed and a page will be built to integrate all search results.
Note: See TracChangeset for help on using the changeset viewer.