BP_Invites_Component::setup_admin_bar( array $wp_admin_nav = array() )

Set up the component entries in the WordPress Admin Bar.

Description

See also

Parameters

$wp_admin_nav

(array) (Optional) See BP_Component::setup_admin_bar() for a description.

Default value: array()

Source

File: bp-invites/classes/class-bp-invites-component.php

	public function setup_admin_bar( $wp_admin_nav = array() ) {

		// Menus for logged in user.
		if ( is_user_logged_in() ) {

			if ( true === bp_allow_user_to_send_invites() ) {
				// Setup the logged in user variables.
				$invites_link = trailingslashit( bp_loggedin_user_domain() . bp_get_invites_slug() );

				$title = __( 'Email Invites', 'buddyboss' );

				// Add the "My Account" sub menus.
				$wp_admin_nav[] = array(
					'parent' => buddypress()->my_account_menu_id,
					'id'     => 'my-account-' . $this->id,
					'title'  => $title,
					'href'   => $invites_link
				);

				// Invite by Email
				$wp_admin_nav[] = array(
					'parent'   => 'my-account-' . $this->id,
					'id'       => 'my-account-' . $this->id . '-invites',
					'title'    => __( 'Send Invites', 'buddyboss' ),
					'href'     => $invites_link,
					'position' => 10
				);

				// Sent Invites
				$wp_admin_nav[] = array(
					'parent'   => 'my-account-' . $this->id,
					'id'       => 'my-account-' . $this->id . '-sent',
					'title'    => __( 'Sent Invites', 'buddyboss' ),
					'href'     => $invites_link . 'sent-invites',
					'position' => 20
				);
			}

		}

		parent::setup_admin_bar( $wp_admin_nav );
	}

Changelog

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.