bp_nouveau_get_nav_scope()

Retrieve the specific scope for the current nav item.


Return Return

(string) the specific scope of the nav.


Source Source

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

	function bp_nouveau_get_nav_scope() {
		$bp_nouveau = bp_nouveau();
		$nav_item   = $bp_nouveau->current_nav_item;
		$scope      = array();

		if ( 'directory' === $bp_nouveau->displayed_nav ) {
			$scope = array( 'data-bp-scope' => $nav_item->slug );

		} elseif ( 'personal' === $bp_nouveau->displayed_nav && ! empty( $nav_item->secondary ) ) {
			$scope = array( 'data-bp-user-scope' => $nav_item->slug );

		} else {
			/**
			 * Filter to add your own scope.
			 *
			 * @since 3.0.0
			 *
			 * @param array $scope     Contains the key and the value for your scope.
			 * @param object $nav_item The current nav item object.
			 * @param string $value    The current nav in use (eg: 'directory', 'groups', 'personal', etc..).
			 */
			$scope = apply_filters( 'bp_nouveau_set_nav_scope', $scope, $nav_item, $bp_nouveau->displayed_nav );
		}

		if ( ! $scope ) {
			return '';
		}

		return bp_get_form_field_attributes( 'scope', $scope );
	}


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.