This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_bp_nav_menu_sort( array $a, array $b )

Sort BuddyPress nav menu items by their position property.

Description

This is an internal convenience function and it will probably be removed in a later release. Do not use.

Parameters

$a

(array) (Required) First item.

$b

(array) (Required) Second item.

Return

(int) Returns an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Source

File: bp-core/bp-core-template.php

function _bp_nav_menu_sort( $a, $b ) {
	if ( $a['position'] == $b['position'] ) {
		return 0;
	} elseif ( $a['position'] < $b['position'] ) {
		return -1;
	} else {
		return 1;
	}
}

Changelog

Changelog
Version Description
BuddyPress 1.7.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.