BP_Core_Nav::get_secondary( array $args = array(), bool $sort = true )

Gets the secondary nav items.


Description Description


Parameters Parameters

$args

(Optional) Filters to select the specific secondary items. See wp_list_filter().

Default value: array()

$sort

(Optional) True to sort the nav items. False otherwise.

Default value: true


Top ↑

Return Return

(bool|array) The list of secondary objects nav, or false if none set.


Top ↑

Source Source

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

	public function get_secondary( $args = array(), $sort = true ) {
		$params = wp_parse_args( $args, array( 'parent_slug' => '' ) );

		// No need to search children if the parent is not set.
		if ( empty( $params['parent_slug'] ) && empty( $params['secondary'] ) ) {
			return false;
		}

		$secondary_nav = wp_list_filter( $this->nav[ $this->object_id ], $params );

		if ( ! $secondary_nav ) {
			return false;
		}

		if ( true !== $sort ) {
			return $secondary_nav;
		}

		return $this->sort_nav( $secondary_nav );
	}

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.