bp_nouveau_get_nav_link()

Retrieve the URL for the current nav item.

Description

Return

(string) The URL for the nav item.

Source

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

1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
function bp_nouveau_get_nav_link() {
    $bp_nouveau = bp_nouveau();
    $nav_item   = $bp_nouveau->current_nav_item;
 
    $link = '#';
    if ( ! empty( $nav_item->link ) ) {
        $link = $nav_item->link;
    }
 
    if ( 'personal' === $bp_nouveau->displayed_nav && ! empty( $nav_item->primary ) ) {
        if ( bp_loggedin_user_domain() ) {
            $link = str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $link );
        } else {
            $link = trailingslashit( bp_displayed_user_domain() . $link );
        }
    }
 
    /**
     * Filter to edit the URL of the nav item.
     *
     * @since BuddyPress 3.0.0
     *
     * @param string $link     The URL for the nav item.
     * @param object $nav_item The current nav item object.
     * @param string $value    The current nav in use (eg: 'directory', 'groups', 'personal', etc..).
     */
    return apply_filters( 'bp_nouveau_get_nav_link', $link, $nav_item, $bp_nouveau->displayed_nav );
}

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.