Skip to:
Content

BuddyPress.org

Ticket #1462: bp-default.diff

File bp-default.diff, 1.0 KB (added by wpmuguru, 17 years ago)
  • bp-themes/bp-default/functions.php

     
    5050                return $fullname[0];
    5151}
    5252
     53function bp_dtheme_warn_deactivated() {
     54        echo "<div class='updated fade'><h3>" . __( 'BuddyPress is not active, please change themes', 'buddypress') .  "</h3></div>";
     55}
     56
    5357function bp_dtheme_remove_redundant() {
    5458        global $bp;
    5559
    5660        /* Remove the redundant "My Posts and My Comments" options since we can use filters on the activity stream. */
    57         bp_core_remove_subnav_item( $bp->blogs->slug, 'recent-posts' );
    58         bp_core_remove_subnav_item( $bp->blogs->slug, 'recent-comments' );
     61        if( isset( $bp ) ) {
     62                bp_core_remove_subnav_item( $bp->blogs->slug, 'recent-posts' );
     63                bp_core_remove_subnav_item( $bp->blogs->slug, 'recent-comments' );
     64        } elseif( is_admin( ) ) {
     65                add_action( 'admin_notices', 'bp_dtheme_warn_deactivated' );
     66        }
    5967}
    6068add_action( 'init', 'bp_dtheme_remove_redundant' );
    6169