bbp_admin_separator()
Add a separator to the WordPress admin menus
Description
Source
File: bp-forums/admin/functions.php
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
| 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.