bp_nouveau_messages_adjust_nav()


Source Source

File: bp-templates/bp-nouveau/includes/messages/functions.php

function bp_nouveau_messages_adjust_nav() {
	$bp = buddypress();

	$secondary_nav_items = $bp->members->nav->get_secondary( array( 'parent_slug' => bp_nouveau_get_component_slug( 'messages' ) ), false );

	if ( empty( $secondary_nav_items ) ) {
		return;
	}

	foreach ( $secondary_nav_items as $secondary_nav_item ) {
		if ( empty( $secondary_nav_item->slug ) ) {
			continue;
		}

		if ( 'notices' === $secondary_nav_item->slug ) {
			bp_core_remove_subnav_item( bp_nouveau_get_component_slug( 'messages' ), $secondary_nav_item->slug, 'members' );
		} elseif ( 'compose' === $secondary_nav_item->slug ) {
			$bp->members->nav->edit_nav( array(
				'user_has_access' => bp_is_my_profile()
			), $secondary_nav_item->slug, bp_nouveau_get_component_slug( 'messages' ) );
		}
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.