Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/24/2011 05:26:18 AM (10 years ago)
Author:
johnjamesjacoby
Message:

This first pass at WP Admin Bar integration unhooks all WP core menus and replaces them with a full set of action based routines to handle the creation of admin bar menus at a BP component class level. This allows future external components to manipulate core menus or add their own with relative ease. Currently works off the BP_USE_WP_ADMIN_BAR constant, and should eventually phase out the BuddyBar in the long-term.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-loader.php

    r4041 r4151  
    113113        parent::_setup_nav( $main_nav );
    114114    }
    115    
     115
     116    /**
     117     * Set up the admin bar
     118     *
     119     * @global obj $bp
     120     */
     121    function _setup_admin_bar() {
     122        global $bp;
     123
     124        // Menus for logged in user
     125        if ( is_user_logged_in() ) {
     126
     127            $blogs_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
     128
     129            // Add the "Blogs" sub menu
     130            $wp_admin_nav[] = array(
     131                'parent' => $bp->my_account_menu_id,
     132                'id'     => 'my-account-' . $this->id,
     133                'title'  => __( 'Blogs', 'buddypress' ),
     134                'href'   => trailingslashit( $blogs_link )
     135            );
     136
     137            // My Blogs
     138            $wp_admin_nav[] = array(
     139                'parent' => 'my-account-' . $this->id,
     140                'title'  => __( 'My Blogs', 'buddypress' ),
     141                'href'   => trailingslashit( $blogs_link . 'my-blogs' )
     142            );
     143
     144        }
     145
     146        parent::_setup_admin_bar( $wp_admin_nav );
     147    }
     148
    116149    /**
    117150     * Sets up the title for pages and <title>
Note: See TracChangeset for help on using the changeset viewer.