bbp_admin_separator()

Add a separator to the WordPress admin menus

Description

Source

File: bp-forums/admin/functions.php

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function bbp_admin_separator() {
 
    // Caps necessary where a separator is necessary
    $caps = array(
        'bbp_forums_admin',
        'bbp_topics_admin',
        'bbp_replies_admin',
    );
 
    // Loop through caps, and look for a reason to show the separator
    foreach ( $caps as $cap ) {
        if ( current_user_can( $cap ) ) {
            bbpress()->admin->show_separator = true;
            break;
        }
    }
 
    // Bail if no separator
    if ( false === bbpress()->admin->show_separator ) {
        return;
    }
 
    global $menu;
 
    $menu[] = array( '', 'read', 'separator-bbpress', '', 'wp-menu-separator bbpress' );
}

Changelog

Changelog
Version Description
bbPress (r2957) 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.