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
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
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.