bp_nouveau_get_nav_link_id()

Retrieve the id attribute of the link for the current nav item.


Return Return

(string) The link id for the nav item.


Source Source

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

	function bp_nouveau_get_nav_link_id() {
		$bp_nouveau = bp_nouveau();
		$nav_item   = $bp_nouveau->current_nav_item;
		$link_id   = '';

		if ( ( 'groups' === $bp_nouveau->displayed_nav || 'personal' === $bp_nouveau->displayed_nav ) && ! empty( $nav_item->css_id ) ) {
			$link_id = $nav_item->css_id;

			if ( ! empty( $nav_item->primary ) && 'personal' === $bp_nouveau->displayed_nav ) {
				$link_id = 'user-' . $link_id;
			}
		} else {
			$link_id = $nav_item->slug;
		}

		/**
		 * Filter to edit the link id attribute of the nav.
		 *
		 * @since 3.0.0
		 *
		 * @param string $link_id  The link id attribute for the nav item.
		 * @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_link_id', $link_id, $nav_item, $bp_nouveau->displayed_nav );
	}


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.