Skip to:
Content

BuddyPress.org

Changeset 5225


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-core/bp-core-functions.php

    r5220 r5225  
    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.