BP_Settings_Component::setup_admin_bar( array $wp_admin_nav = array() )
Set up the Toolbar.
Description
Parameters
- $wp_admin_nav
-
(Optional) Array of Admin Bar items.
Default value: array()
Source
File: bp-settings/classes/class-bp-settings-component.php
public function setup_admin_bar( $wp_admin_nav = array() ) { // Menus for logged in user. if ( is_user_logged_in() ) { // Setup the logged in user variables. $settings_link = trailingslashit( bp_loggedin_user_domain() . bp_get_settings_slug() ); // Add main Settings menu. $wp_admin_nav[] = array( 'parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => __( 'Account', 'buddyboss' ), 'href' => $settings_link ); // General Account. $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-general', 'title' => __( 'Login Information', 'buddyboss' ), 'href' => $settings_link, 'position' => 10 ); // Notifications - only add the tab when there is something to display there. if ( has_action( 'bp_notification_settings' ) ) { $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-notifications', 'title' => __( 'Email Preferences', 'buddyboss' ), 'href' => trailingslashit( $settings_link . 'notifications' ), 'position' => 20 ); } $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-export', 'title' => __( 'Export Data', 'buddyboss' ), 'href' => trailingslashit( $settings_link . 'export/' ), 'position' => 50 ); // Delete Account if ( !bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) { $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-delete-account', 'title' => __( 'Delete Account', 'buddyboss' ), 'href' => trailingslashit( $settings_link . 'delete-account' ), 'position' => 90 ); } } parent::setup_admin_bar( $wp_admin_nav ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.5.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.