BP_Core_Nav::add_nav( array $args )
Adds a new nav item.
Description Description
Parameters Parameters
- $args
-
(Required) The nav item's arguments.
Return Return
Source Source
File: bp-core/classes/class-bp-core-nav.php
public function add_nav( $args ) { if ( empty( $args['slug'] ) ) { return false; } // We have a child and the parent exists. if ( ! empty( $args['parent_slug'] ) ) { $slug = $args['parent_slug'] . '/' . $args['slug']; $args['secondary'] = true; // This is a parent. } else { $slug = $args['slug']; $args['primary'] = true; } // Add to the nav. $this->nav[ $this->object_id ][ $slug ] = new BP_Core_Nav_Item( $args ); return $this->nav[ $this->object_id ][ $slug ]; }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |