BP_Admin::buddyboss_menu_order( int $menu_order )

Add the separator above the BuddyBoss menu in admin.

Description

Parameters

$menu_order

(Required) Menu order.

Return

(array)

Source

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

238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
public function buddyboss_menu_order( $menu_order ) {
    // Initialize our custom order array.
    $buddyboss_menu_order = array();
 
    // Get the index of our custom separator.
    $buddyboss_separator = array_search( 'separator-buddyboss-platform', $menu_order, true );
 
    // Loop through menu order and do some rearranging.
    foreach ( $menu_order as $index => $item ) {
 
        if ( 'buddyboss-platform' === $item ) {
            $buddyboss_menu_order[] = 'separator-buddyboss';
            $buddyboss_menu_order[] = $item;
            unset( $menu_order[ $buddyboss_separator ] );
        } elseif ( ! in_array( $item, array( 'separator-buddyboss' ), true ) ) {
            $buddyboss_menu_order[] = $item;
        }
 
    }
 
    // Return order.
    return $buddyboss_menu_order;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.