Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/30/2010 04:50:15 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Only add buttons if components are enabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-themes/bp-default/functions.php

    r3260 r3276  
    337337
    338338// Member Buttons
    339 add_action( 'bp_member_header_actions',    'bp_add_friend_button' );
    340 add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
    341 add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
     339if ( bp_is_active( 'friends' ) )
     340    add_action( 'bp_member_header_actions',    'bp_add_friend_button' );
     341
     342if ( bp_is_active( 'activity' ) )
     343    add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
     344
     345if ( bp_is_active( 'messages' ) )
     346    add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
    342347
    343348// Group Buttons
    344 add_action( 'bp_group_header_actions',     'bp_group_join_button' );
    345 add_action( 'bp_group_header_actions',     'bp_group_new_topic_button' );
    346 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
     349if ( bp_is_active( 'groups' ) ) {
     350    add_action( 'bp_group_header_actions',     'bp_group_join_button' );
     351    add_action( 'bp_group_header_actions',     'bp_group_new_topic_button' );
     352    add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
     353}
    347354
    348355// Blog Buttons
    349 add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
     356if ( bp_is_active( 'blogs' ) )
     357    add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
    350358
    351359?>
Note: See TracChangeset for help on using the changeset viewer.