Advertisement
Guest User

Untitled

a guest
Jul 24th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. function profile_tab_terawallet() {
  2.  
  3.      global $bp;
  4.  
  5.      bp_core_new_nav_item( array(
  6.  
  7.            'name' => 'woo wallet',
  8.  
  9.            'slug' => 'wallet',
  10.  
  11.            'screen_function' => 'wallet_screen',
  12.  
  13.            'position' => 107, //you can make this a variable in your plugin
  14.  
  15.            'parent_url'      => bp_loggedin_user_domain() . '/wallet/',
  16.  
  17.            'parent_slug'     => $bp->profile->slug,
  18.  
  19.            'default_subnav_slug' => 'wallet'
  20.  
  21.      ) );
  22.  
  23. }
  24.  
  25. add_action( 'bp_setup_nav', 'profile_tab_terawallet' );
  26.  
  27.  
  28.  
  29. function wallet_screen() {    
  30.  
  31.    // Add title and content here - last is to call the members plugin.php template.
  32.  
  33.    add_action( 'bp_template_title', 'wallet_title' );
  34.  
  35.    add_action( 'bp_template_content', 'wallet_content' );
  36.  
  37.    bp_core_load_template( 'buddypress/members/single/plugins' );
  38.  
  39. }
  40.  
  41. function wallet_title() {
  42.  
  43.    echo 'my virtual wallet';
  44.  
  45. }
  46.  
  47. function wallet_content() {
  48.  
  49.  echo do_shortcode( '[woo-wallet]' );
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement