Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/09/2013 02:27:07 PM (13 years ago)
Author:
boonebgorges
Message:

Add "About BuddyPress" link to WP-logo menu on admin bar.

For parity with bbPress.

Fixes #5285

Props netweb

File:
1 edited

Legend:

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

    r7656 r7659  
    151151                add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) );
    152152
     153                // Add a link to BuddyPress About page to the admin bar
     154                add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 );
     155
    153156                /** Filters ***********************************************************/
    154157
     
    332335                                register_setting  ( 'buddypress',         '_bp_enable_akismet',   'intval'                                                                                  );
    333336                        }
     337                }
     338        }
     339
     340        /**
     341         * Add a link to BuddyPress About page to the admin bar.
     342         *
     343         * @since BuddyPress (1.9.0)
     344         *
     345         * @param WP_Admin_Bar $wp_admin_bar As passed to 'admin_bar_menu'.
     346         */
     347        public function admin_bar_about_link( $wp_admin_bar ) {
     348                if ( is_user_logged_in() ) {
     349                        $wp_admin_bar->add_menu( array(
     350                                'parent' => 'wp-logo',
     351                                'id'     => 'bp-about',
     352                                'title'  => esc_html__( 'About BuddyPress', 'buddypress' ),
     353                                'href'   => add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ),
     354                        ) );
    334355                }
    335356        }
Note: See TracChangeset for help on using the changeset viewer.