bp_admin_separator

Add a separator to the WordPress admin menus.

Description

bp_admin_separator(); 

Usage

  1. if ( !function_exists( 'bp_admin_separator' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_admin_separator(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_admin_separator() { 
  2.  
  3. // Bail if BuddyPress is not network activated and viewing network admin. 
  4. if ( is_network_admin() && ! bp_is_network_activated() ) { 
  5. return; 
  6.  
  7. // Bail if BuddyPress is network activated and viewing site admin. 
  8. if ( ! is_network_admin() && bp_is_network_activated() ) { 
  9. return; 
  10.  
  11. // Prevent duplicate separators when no core menu items exist. 
  12. if ( ! bp_current_user_can( 'bp_moderate' ) ) { 
  13. return; 
  14.  
  15. // Bail if there are no components with admin UI's. Hardcoded for now, until 
  16. // there's a real API for determining this later. 
  17. if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) ) { 
  18. return; 
  19.  
  20. global $menu; 
  21.  
  22. $menu[] = array( '', 'read', 'separator-buddypress', '', 'wp-menu-separatorbuddypress );