bp_gifts_setup_nav

Bp_gifts_setup_nav().

Description

bp_gifts_setup_nav(); 

Sets up the user profile navigation items for the component. This adds the top level nav

item and all the sub level nav items to the navigation array. This is then

rendered in the template.


Usage

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

Defined (1)

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

/includes/bp-gifts-core.php  
  1. function bp_gifts_setup_nav() { 
  2.  
  3. global $bp; 
  4.  
  5.  
  6.  
  7. /** Add 'Gifts' to the main user profile navigation */ 
  8.  
  9. bp_core_new_nav_item( array( 
  10.  
  11. 'name' => __( 'Gifts', 'bp-gifts' ),  
  12.  
  13. 'slug' => $bp->gifts->slug,  
  14.  
  15. 'position' => 80,  
  16.  
  17. 'screen_function' => 'bp_gifts_screen',  
  18.  
  19. 'default_subnav_slug' => 'screen-one' 
  20.  
  21. ) ); 
  22.  
  23.  
  24.  
  25. $gifts_link = $bp->loggedin_user->domain . $bp->gifts->slug . '/'; 
  26.  
  27.  
  28.  
  29. /** Create two sub nav items for this component */ 
  30.  
  31. bp_core_new_subnav_item( array( 
  32.  
  33. 'name' => __( '', 'bp-gifts' ),  
  34.  
  35. 'slug' => 'screen-one',  
  36.  
  37. 'parent_slug' => $bp->gifts->slug,  
  38.  
  39. 'parent_url' => $gifts_link,  
  40.  
  41. 'screen_function' => 'bp_gifts_screen',  
  42.  
  43. 'position' => 10 
  44.  
  45. ) ); 
  46.