bp_nouveau_get_single_item_nav_classes()

Returns the single item nav container classes

Description

Return

(string) CSS classes

Source

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

1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
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();
 
    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 BuddyPress 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 );
}

Changelog

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.