[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-core-nav.php (summary)

Core component class.

File Size: 419 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Core_Nav:: (12 methods):
  __construct()
  __isset()
  __get()
  __set()
  get()
  add_nav()
  edit_nav()
  delete_nav()
  sort_nav()
  get_primary()
  get_secondary()
  get_item_nav()


Class: BP_Core_Nav  - X-Ref

BuddyPress Nav.

This class is used to build each component's navigation.

__construct( $object_id = 0 )   X-Ref
Initializes the Nav belonging to the specified object.

param: int $object_id The item ID to build the nav for. Default is the displayed user ID.
since: 2.6.0

__isset( $key )   X-Ref
Checks whether a nav item is set.

return: bool True if the nav item is set, false otherwise.
param: string $key The requested nav slug.
since: 2.6.0

__get( $key )   X-Ref
Gets a nav item.

return: mixed The value corresponding to the requested nav item.
param: string $key The requested nav slug.
since: 2.6.0

__set( $key, $value )   X-Ref
Sets a nav item.

param: string $key   The requested nav slug.
param: mixed  $value The value of the nav item.
since: 2.6.0

get( $key = '' )   X-Ref
Gets a specific nav item or array of nav items.

return: mixed       An array of nav item, a single nav item, or null if none found.
param: string $key The nav item slug to get. Optional.
since: 2.6.0

add_nav( $args )   X-Ref
Adds a new nav item.

return: BP_Core_Nav_Item
param: array $args The nav item's arguments.
since: 2.6.0

edit_nav( $args = array()   X-Ref
Edits a nav item.

return: BP_Core_Nav_Item
param: array  $args        The nav item's arguments.
param: string $slug        The slug of the nav item.
param: string $parent_slug The slug of the parent nav item (required to edit a child).
since: 2.6.0

delete_nav( $slug = '', $parent_slug = '' )   X-Ref
Unset an item or a subitem of the nav.

return: false|callable|array False on failure, the screen function(s) on success.
param: string $slug        The slug of the main item.
param: string $parent_slug The slug of the sub item.
since: 2.6.0

sort_nav( $items )   X-Ref
Sorts a list of nav items.

return: array
param: array $items The nav items to sort.
since: 2.6.0

get_primary( $args = array()   X-Ref
Gets the primary nav items.

return: array The list of primary objects nav
param: array $args Filters to select the specific primary items. See wp_list_filter().
param: bool  $sort True to sort the nav items. False otherwise.
since: 2.6.0

get_secondary( $args = array()   X-Ref
Gets the secondary nav items.

return: bool|array The list of secondary objects nav, or false if none set.
param: array $args Filters to select the specific secondary items. See wp_list_filter().
param: bool  $sort True to sort the nav items. False otherwise.
since: 2.6.0

get_item_nav()   X-Ref
Gets a nested list of visible nav items.

return: array The list of visible nav items.
since: 2.6.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1