bp_groupblog_add_admin_menu

Bp_groupblog_add_admin_menu().

Description

bp_groupblog_add_admin_menu(); 

Usage

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

Defined (1)

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

/bp-groupblog-admin.php  
  1. function bp_groupblog_add_admin_menu() { 
  2. global $wpdb, $bp; 
  3.  
  4. if ( !is_super_admin() ) 
  5. return false; 
  6.  
  7. // test for BP1.6+ (truncated to allow testing on beta versions) 
  8. if ( version_compare( substr( BP_VERSION, 0, 3 ), '1.6', '>=' ) ) { 
  9.  
  10. // BuddyPress 1.6 moves its admin pages elsewhere, so use Settings menu 
  11. $location = 'settings.php'; 
  12.  
  13. } else { 
  14.  
  15. // versions prior to 1.6 have a BuddyPress top-level menu 
  16. $location = 'bp-general-settings'; 
  17.  
  18.  
  19. /** Add the administration tab under the "Site Admin" tab for site administrators */ 
  20. $page = add_submenu_page(  
  21.  
  22. $location,  
  23. __( 'GroupBlog Setup', 'groupblog' ),  
  24. '<span class="bp-groupblog-admin-menu-header">' . __( 'GroupBlog Setup', 'groupblog' ) . '   </span>',  
  25. 'manage_options',  
  26.  
  27. ); 
  28.  
  29. // add styles only on bp-groupblog admin page, see: 
  30. // http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Load_scripts_only_on_plugin_pages 
  31.