bp_admin_do_wp_nav_menu_meta_box

Build and populate the BuddyPress accordion on Appearance > Menus.

Description

bp_admin_do_wp_nav_menu_meta_box(); 

Usage

  1. if ( !function_exists( 'bp_admin_do_wp_nav_menu_meta_box' ) ) { 
  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_do_wp_nav_menu_meta_box(); 
  7.  

Defined (1)

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

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_admin_do_wp_nav_menu_meta_box() { 
  2. global $nav_menu_selected_id; 
  3.  
  4. $walker = new BP_Walker_Nav_Menu_Checklist( false ); 
  5. $args = array( walker => $walker ); 
  6.  
  7. $post_type_name = buddypress; 
  8.  
  9. $tabs = array(); 
  10.  
  11. $tabs['loggedin']['label'] = __( 'Logged-In', buddypress ); 
  12. $tabs['loggedin']['pages'] = bp_nav_menu_get_loggedin_pages(); 
  13.  
  14. $tabs['loggedout']['label'] = __( 'Logged-Out', buddypress ); 
  15. $tabs['loggedout']['pages'] = bp_nav_menu_get_loggedout_pages(); 
  16.  
  17. ?> 
  18.  
  19. <div id="buddypress-menu" class="posttypediv"> 
  20. <h4><?php _e( 'Logged-In', buddypress ) ?></h4> 
  21. <p><?php _e( '<em>Logged-In</em> links are relative to the current user, and are not visible to visitors who are not logged in.', buddypress ) ?></p> 
  22.  
  23. <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedin" class="tabs-panel tabs-panel-active"> 
  24. <ul id="buddypress-menu-checklist-loggedin" class="categorychecklist form-no-clear"> 
  25. <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedin']['pages'] ), 0, (object) $args );?> 
  26. </ul> 
  27. </div> 
  28.  
  29. <h4><?php _e( 'Logged-Out', buddypress ) ?></h4> 
  30. <p><?php _e( '<em>Logged-Out</em> links are not visible to users who are logged in.', buddypress ) ?></p> 
  31.  
  32. <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedout" class="tabs-panel tabs-panel-active"> 
  33. <ul id="buddypress-menu-checklist-loggedout" class="categorychecklist form-no-clear"> 
  34. <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedout']['pages'] ), 0, (object) $args );?> 
  35. </ul> 
  36. </div> 
  37.  
  38. <?php 
  39. $removed_args = array( 
  40. 'action',  
  41. 'customlink-tab',  
  42. 'edit-menu-item',  
  43. 'menu-item',  
  44. 'page-tab',  
  45. '_wpnonce',  
  46. ); 
  47. ?> 
  48.  
  49. <p class="button-controls"> 
  50. <span class="list-controls"> 
  51. <a href="<?php 
  52. array( 
  53. $post_type_name . '-tab' => 'all',  
  54. 'selectall' => 1,  
  55. ),  
  56. remove_query_arg( $removed_args ) 
  57. ) ); 
  58. ?>#buddypress-menu" class="select-all"><?php _e( 'Select All', buddypress ); ?></a> 
  59. </span> 
  60. <span class="add-to-menu"> 
  61. <input type="submit"<?php if ( function_exists( 'wp_nav_menu_disabled_check' ) ) : wp_nav_menu_disabled_check( $nav_menu_selected_id ); endif; ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', buddypress ); ?>" name="add-custom-menu-item" id="submit-buddypress-menu" /> 
  62. <span class="spinner"></span> 
  63. </span> 
  64. </p> 
  65. </div><!-- /#buddypress-menu --> 
  66.  
  67. <?php