bp_nouveau_get_nav_id()

Retrieve the ID attribute of the current nav item.

Description

Return

(string) the ID attribute.

Source

File: bp-templates/bp-nouveau/includes/template-tags.php

	function bp_nouveau_get_nav_id() {
		$bp_nouveau = bp_nouveau();
		$nav_item   = $bp_nouveau->current_nav_item;

		if ( 'directory' === $bp_nouveau->displayed_nav ) {
			$id = sprintf( '%1$s-%2$s', $nav_item->component, $nav_item->slug );
		} elseif ( 'groups' === $bp_nouveau->displayed_nav || 'personal' ===  $bp_nouveau->displayed_nav ) {
			$id = sprintf( '%1$s-%2$s-li', $nav_item->css_id, $bp_nouveau->displayed_nav );
		} else {
			$id = $nav_item->slug;
		}

		/**
		 * Filter to edit the ID attribute of the nav.
		 *
		 * @since BuddyPress 3.0.0
		 *
		 * @param string $id       The ID attribute of the nav.
		 * @param object $nav_item The current nav item object.
		 * @param string $value    The current nav in use (eg: 'directory', 'groups', 'personal', etc..).
		 */
		return apply_filters( 'bp_nouveau_get_nav_id', $id, $nav_item, $bp_nouveau->displayed_nav );
	}

Changelog

Changelog
Version Description
BuddyPress 3.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.