bp_nouveau_get_directory_type_navs_class()
Provides default nav wrapper classes.
Description
Gets the directory component nav class. Gets user selection Customizer options.
Return
(string)
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 BuddyPress 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 ) );
}
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.