BP_Core_Nav::get( string $key = '' )

Gets a specific nav item or array of nav items.


Description Description


Parameters Parameters

$key

(Optional) The nav item slug to get. Optional.

Default value: ''


Top ↑

Return Return

(mixed) An array of nav item, a single nav item, or null if none found.


Top ↑

Source Source

File: bp-core/classes/class-bp-core-nav.php

	public function get( $key = '' ) {
		$return = null;

		// Return the requested nav item.
		if ( ! empty( $key ) ) {
			if ( ! isset( $this->nav[ $this->object_id ][ $key ] ) ) {
				$return = null;
			} else {
				$return = $this->nav[ $this->object_id ][ $key ];
			}

		// Return all nav item items.
		} else {
			$return = $this->nav[ $this->object_id ];
		}

		return $return;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.