Skip to:
Content

BuddyPress.org

Ticket #2449: 2449.001.diff

File 2449.001.diff, 1.0 KB (added by cnorris23, 16 years ago)

update of rvenable's patch

  • bp-themes/bp-default/functions.php

     
    128128}
    129129add_action( 'pre_get_posts', 'bp_dtheme_fix_get_posts_on_activity_front' );
    130130
     131/* WP 3.0 requires there to be a non-null post in the posts array */
     132function bp_dtheme_fix_the_posts_on_activity_front( $posts ) {
     133        global $wp_query;
     134
     135        // NOTE: the double quotes around '"activity"' are thanks to our previous function bp_dtheme_fix_get_posts_on_activity_front()
     136        if ( empty( $posts ) && !empty( $wp_query->query_vars['page_id'] ) && '"activity"' == $wp_query->query_vars['page_id'] )
     137                $posts = array( (object) array( 'ID' => 'activity' ) );
     138
     139        return $posts;
     140}
     141add_filter( 'the_posts', 'bp_dtheme_fix_the_posts_on_activity_front' );
     142
    131143/****
    132144 * Custom header image support. You can remove this entirely in a child theme by adding this line
    133145 * to your functions.php: define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );