bp_nouveau_get_document_directory_nav_items()
Get the nav items for the Media directory
Description
Return
(array) An associative array of nav items.
Source
File: bp-templates/bp-nouveau/includes/document/functions.php
function bp_nouveau_get_document_directory_nav_items() {
$nav_items = array();
$nav_items['all'] = array(
'component' => 'document',
'slug' => 'all', // slug is used because BP_Core_Nav requires it, but it's the scope.
'li_class' => array(),
'link' => bp_get_document_directory_permalink(),
'text' => __( 'All Documents', 'buddyboss' ),
//'count' => bp_get_total_document_count(),
'position' => 5,
);
if ( is_user_logged_in() && bp_is_profile_document_support_enabled() ) {
$nav_items['personal'] = array(
'component' => 'document',
'slug' => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope.
'li_class' => array(),
'link' => bp_loggedin_user_domain() . bp_get_document_slug() . '/my-document/',
'text' => __( 'My Documents', 'buddyboss' ),
//'count' => bp_document_get_total_document_count(),
'position' => 15,
);
}
if ( is_user_logged_in() && bp_is_active( 'groups' ) && bp_is_group_document_support_enabled() ) {
$nav_items['group'] = array(
'component' => 'document',
'slug' => 'groups', // slug is used because BP_Core_Nav requires it, but it's the scope.
'li_class' => array(),
'link' => bp_loggedin_user_domain() . bp_get_document_slug() . '/groups-document/',
'text' => __( 'My Groups', 'buddyboss' ),
//'count' => bp_document_get_total_document_count(),
'position' => 15,
);
}
/**
* Use this filter to introduce your custom nav items for the media directory.
*
* @since BuddyBoss 1.4.0
*
* @param array $nav_items The list of the media directory nav items.
*/
return apply_filters( 'bp_nouveau_get_document_directory_nav_items', $nav_items );
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.4.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.