bp_groupblog_setup_nav

Bp_groupblog_setup_nav().

Description

bp_groupblog_setup_nav(); 

Usage

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

Defined (1)

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

/bp-groupblog.php  
  1. function bp_groupblog_setup_nav() { 
  2. global $bp, $current_blog; 
  3.  
  4. if ( bp_is_group() ) { 
  5.  
  6. $bp->groups->current_group->is_group_visible_to_member = ( 'public' == $bp->groups->current_group->status || groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) ? true : false; 
  7.  
  8. $group_link = bp_get_group_permalink( groups_get_current_group() ); 
  9.  
  10. $checks = get_site_option('bp_groupblog_blog_defaults_options'); 
  11.  
  12. if ( !$checks['deep_group_integration'] ) { 
  13.  
  14. $parent_slug = isset( $bp->bp_nav[$bp->groups->current_group->slug] ) ? $bp->groups->current_group->slug : $bp->groups->slug; 
  15.  
  16. if ( 
  17.  
  18. // existing groupblog logic 
  19. bp_groupblog_is_blog_enabled( $bp->groups->current_group->id ) 
  20.  
  21. OR 
  22.  
  23. // mahype's fixes for the non-appearance of the groupblog tab 
  24. // with the addition of a check for the array key to prevent PHP notices. 
  25. isset( $_POST['groupblog-create-new'] ) AND 
  26. $_POST['groupblog-create-new'] == 'yes' 
  27.  
  28. ) { 
  29.  
  30. // add a filter so plugins can change the name 
  31. $name = __( 'Blog', 'groupblog' ); 
  32. $name = apply_filters( 'bp_groupblog_subnav_item_name', $name ); 
  33.  
  34. // add a filter so plugins can change the slug 
  35. $slug = apply_filters( 'bp_groupblog_subnav_item_slug', 'blog' ); 
  36.  
  37. bp_core_new_subnav_item( 
  38. array( 
  39. 'name' => $name,  
  40. 'slug' => $slug,  
  41. 'parent_url' => $group_link,  
  42. 'parent_slug' => $parent_slug,  
  43. 'screen_function' => 'groupblog_screen_blog',  
  44. 'position' => 32,  
  45. 'item_css_id' => 'group-blog' 
  46. );