Add tab to activity page

DescriptionBuddypress snippet by - 11/24/10

Use this to add extra tabs to the activity page on your buddypress install.
function my_theme_add_activity_tab() {
  if ( !is_user_logged_in() )
    return false;
?>
  <li id="activity-myclass">
    <a href="<?php echo site_url( BP_ACTIVITY_SLUG . '/#myclass/' ) ?>" title="<?php _e( 'Activity for my Class Year.', 'buddypress' ) ?>">
      <?php printf( __( 'My Class', 'buddypress' ) ) ?>
    </a>
  </li>
<?php
}
add_action( 'bp_activity_type_tabs', 'my_theme_add_activity_tab' );
  • Share
Authored by: Adam J Nowak
http://hyperspatial.com

3 Responses to “Add tab to activity page”

  1. Hello,
    thanks again for another very useful code , really appreciate this site , I have added new tab (Music & Video ) below main ACTIVITY TAB , working fine with oembed You tube plugin and the videos from there , but below that new TAB are also another previous activity items (post updates , events updates etc. ) How can I do the Tab content unique for only this Music & Video and NOT for anything else ?

  2. I did a lot of hacking related to this and had troubles. I think a better route is to learn how to create a buddypress component. Its pretty complicated but worth it in the longrun. There is actually a wordpress plugin called buddypress component skeleton you can install via the wordpress plugin system.

    Good, luck. Like I said the bp component is complicated but works better than hacking the tabs.

  3. Ok , Adam , no problem , thanks for your respond , this function is not too much important to me anyway .

Comments and Feedback