bp_admin_separator()

Add a separator to the WordPress admin menus.

Description

Source

File: bp-core/admin/bp-core-admin-functions.php

1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
function bp_admin_separator() {
 
    // Bail if BuddyPress is not network activated and viewing network admin.
    if ( is_network_admin() && ! bp_is_network_activated() ) {
        return;
    }
 
    // Bail if BuddyPress is network activated and viewing site admin.
    if ( ! is_network_admin() && bp_is_network_activated() ) {
        return;
    }
 
    // Prevent duplicate separators when no core menu items exist.
    if ( ! bp_current_user_can( 'bp_moderate' ) ) {
        return;
    }
 
    // Bail if there are no components with admin UI's. Hardcoded for now, until
    // there's a real API for determining this later.
    if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) ) {
        return;
    }
 
    global $menu;
 
    $menu[] = array( '', 'read', 'separator-buddypress', '', 'wp-menu-separator buddypress' );
}

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.