bp_nouveau_get_directory_type_navs_class()

Provides default nav wrapper classes.


Description Description

Gets the directory component nav class. Gets user selection Customizer options.


Top ↑

Return Return

(string)


Source Source

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

	function bp_nouveau_get_directory_type_navs_class() {
		$component  = sanitize_key( bp_current_component() );

		// If component is 'blogs' we need to access options as 'Sites'.
		if ('blogs' === $component) {
			$component = 'sites';
		};

		$customizer_option = sprintf( '%s_dir_tabs', $component );
		$nav_style  = bp_nouveau_get_temporary_setting( $customizer_option, bp_nouveau_get_appearance_settings( $customizer_option ) );
		$tab_style = '';

		if ( 1 === $nav_style ) {
			$tab_style = $component . '-nav-tabs';
		}

		$nav_wrapper_classes = array(
			sprintf( '%s-type-navs', $component ),
			'main-navs',
			'bp-navs',
			'dir-navs',
			$tab_style
		);

		/**
		 * Filter to edit/add classes.
		 *
		 * NB: you can also directly add classes to the class attr.
		 *
		 * @since 3.0.0
		 *
		 * @param array $nav_wrapper_classes The list of classes.
		 */
		$nav_wrapper_classes = (array) apply_filters( 'bp_nouveau_get_directory_type_navs_class', $nav_wrapper_classes );

		return join( ' ', array_map( 'sanitize_html_class', $nav_wrapper_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.