Skip to:
Content

BuddyPress.org

Changeset 3405


Ignore:
Timestamp:
11/12/2010 11:49:15 PM (15 years ago)
Author:
boonebgorges
Message:

Adds Dashboard adminbar item for non-multisite installations. Fixes #2520. Props hnla

File:
1 edited

Legend:

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

    r3404 r3405  
    156156    echo '</ul>';
    157157    echo '</li>';
     158}
     159
     160function bp_adminbar_thisblog_menu() {
     161    if ( current_user_can( 'edit_posts' ) ) {
     162        echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
     163       
     164        _e( 'Dashboard', 'buddypress' );
     165   
     166        echo '</a>';
     167        echo '<ul>';
     168       
     169        echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
     170        echo '<li class="alt"><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
     171        echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
     172       
     173        do_action( 'bp_adminbar_thisblog_items' );
     174       
     175        echo '</ul>';
     176        echo '</li>';
     177    }
    158178}
    159179
     
    254274if ( is_multisite() )
    255275    add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
     276else
     277    add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );
    256278
    257279add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
Note: See TracChangeset for help on using the changeset viewer.