BP_Core_BP_Nav_BackCompat::get_nav( mixed $offset )
Get the nav object corresponding to the specified offset.
Description
Parameters
- $offset
-
(Required) Array offset.
Return
(bool|array)
Source
File: bp-core/classes/class-bp-core-bp-nav-backcompat.php
protected function get_nav( $offset ) {
$bp = buddypress();
$component_nav = $this->get_component_nav( $offset );
$primary_nav = $component_nav->get_primary( array( 'slug' => $offset ), false );
$nav = array();
if ( empty( $primary_nav ) ) {
return $nav;
}
foreach ( $primary_nav as $item ) {
$nav[ $item->slug ] = (array) $item;
}
return $nav;
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.6.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.