bp_nouveau_get_single_item_nav_classes()

Returns the single item nav container classes


Return Return

(string) CSS classes


Source Source

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

	function bp_nouveau_get_single_item_nav_classes() {
		$classes    = array( 'main-navs', 'no-ajax', 'bp-navs', 'single-screen-navs' );
		$component  = bp_current_component();
		$bp_nouveau = bp_nouveau();

		// @todo wasn't able to get $customizer_option to pass a string to get_settings
		// this is a temp workaround but differs from earlier dir approach- bad!
		if ( bp_is_group() ) {
			$nav_tabs = (int) bp_nouveau_get_temporary_setting( 'group_nav_tabs', bp_nouveau_get_appearance_settings( 'group_nav_tabs' ) );

		} elseif ( bp_is_user() ) {
			$nav_tabs = (int) bp_nouveau_get_temporary_setting( 'user_nav_tabs', bp_nouveau_get_appearance_settings( 'user_nav_tabs' ) );
		}

		if ( bp_is_group() && 1 === $nav_tabs) {
			$classes[] = 'group-nav-tabs';
			$classes[] = 'tabbed-links';
		} elseif ( bp_is_user() && 1 === $nav_tabs ) {
			$classes[] = 'user-nav-tabs';
			$classes[] = 'tabbed-links';
		}

		if ( bp_is_user() ) {
			$component = 'members';
			$menu_type = 'users-nav';
		} else {
			$menu_type = 'groups-nav';
		}

		$customizer_option = ( bp_is_user() )? 'user_nav_display' : 'group_nav_display';

		$layout_prefs = (int) bp_nouveau_get_temporary_setting( $customizer_option, bp_nouveau_get_appearance_settings( $customizer_option ) );

		// Set the global for a later use - this is moved from the `bp_nouveau_get_container_classes()
		// But was set as a check for this array class addition.
		$bp_nouveau->{$component}->single_primary_nav_layout = $layout_prefs;

		if ( 1 === $layout_prefs ) {
			$classes[] = 'vertical';
		} else {
			$classes[] = 'horizontal';
		}

		$classes[] = $menu_type;
		$class = array_map( 'sanitize_html_class', $classes );

		/**
		 * Filters the final results for BuddyPress Nouveau single item nav classes.
		 *
		 * This filter will return a single string of concatenated classes to be used.
		 *
		 * @since 3.0.0
		 *
		 * @param string $value   Concatenated classes.
		 * @param array  $classes Array of classes that were concatenated.
		 */
		return apply_filters( 'bp_nouveau_get_single_item_nav_classes', join( ' ', $class ), $classes );
	}


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.