BP_Media_Component::setup_admin_bar( array $wp_admin_nav = array() )
Set up the component entries in the WordPress Admin Bar.
Description
See also
- BP_Component::setup_nav(): for a description of the $wp_admin_nav parameter array.
Parameters
- $wp_admin_nav
-
(Optional) See BP_Component::setup_admin_bar() for a description.
Default value: array()
Source
File: bp-media/classes/class-bp-media-component.php
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | public function setup_admin_bar( $wp_admin_nav = array () ) { // Menus for logged in user. if ( is_user_logged_in() && bp_is_profile_media_support_enabled() ) { // Setup the logged in user variables. $media_link = trailingslashit( bp_loggedin_user_domain() . bp_get_media_slug() ); // Add main Messages menu. $wp_admin_nav [] = array ( 'parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-' . $this ->id, 'title' => __( 'Photos' , 'buddyboss' ), 'href' => $media_link ); // Media. $wp_admin_nav [] = array ( 'parent' => 'my-account-' . $this ->id, 'id' => 'my-account-' . $this ->id . '-my-media' , 'title' => __( 'My Photos' , 'buddyboss' ), 'href' => $media_link , 'position' => 10 ); if ( bp_is_profile_albums_support_enabled() ) { // Albums. $wp_admin_nav [] = array ( 'parent' => 'my-account-' . $this ->id, 'id' => 'my-account-' . $this ->id . '-albums' , 'title' => __( 'My Albums' , 'buddyboss' ), 'href' => trailingslashit( $media_link . 'albums' ), 'position' => 20 ); } } parent::setup_admin_bar( $wp_admin_nav ); } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.