BP_Core_BP_Nav_BackCompat::get_component( mixed $offset = '' )

Get the component to which the a nav item belongs.


Description Description

We use the following heuristic to guess, based on an offset, which component the item belongs to:

  • If this is a group, and the offset is the same as the current group’s slug, it’s a group nav item.
  • Otherwise, it’s a member nav item.

Parameters Parameters

$offset

(Optional) Array offset.

Default value: ''


Top ↑

Return Return

(string|array)


Top ↑

Source Source

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

	public function get_component( $offset = '' ) {
		if ( ! isset( $this->component ) ) {
			if ( bp_is_active( 'groups' ) && $offset === bp_get_current_group_slug() ) {
				$this->component = 'groups';
			} else {
				$this->component = 'members';
			}
		}

		return $this->component;
	}

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.