BP_Core_Nav::get_primary( array $args = array(), bool $sort = true )
Gets the primary nav items.
Description
Parameters
- $args
-
(Optional) Filters to select the specific primary items. See wp_list_filter().
Default value: array()
- $sort
-
(Optional) True to sort the nav items. False otherwise.
Default value: true
Return
(array) The list of primary objects nav
Source
File: bp-core/classes/class-bp-core-nav.php
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | public function get_primary( $args = array (), $sort = true ) { $params = wp_parse_args( $args , array ( 'primary' => true ) ); // This parameter is not overridable. if ( empty ( $params [ 'primary' ] ) ) { return false; } $primary_nav = wp_list_filter( $this ->nav[ $this ->object_id ], $params ); if ( ! $primary_nav ) { return false; } if ( true !== $sort ) { return $primary_nav ; } return $this ->sort_nav( $primary_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.