Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/08/2011 09:55:15 PM (13 years ago)
Author:
djpaul
Message:

Fix search routing when blog posts aren't displayed on the front of a site. Fixes #3626

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/bp-core/bp-core-functions.php

    r5223 r5226  
    841841                $slug = '';
    842842                $var  = '/?s=';
     843
     844                // If posts aren't displayed on the front page, find the post page's slug.
     845                if ( 'page' == get_option( 'show_on_front' ) ) {
     846                    $page = get_post( get_option( 'page_for_posts' ) );
     847
     848                    if ( !is_wp_error( $page ) && !empty( $page->post_name ) ) {
     849                        $slug = $page->post_name;
     850                        $var  = '?s=';
     851                    }
     852                }
    843853                break;
    844854
Note: See TracChangeset for help on using the changeset viewer.