Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • fancyfiber
    Member

    @fancyfiber

    First thanks to Boone Gorges for the direction on how to get started with this. And for those looking for a complete answer. Add this code (or similar) to your Theme functions.php file (my apologies if there is a better way to paste code…first time posting here):

    function set_default_notifications($user_id, $key, $user) {
    $valueyes = 'yes';
    $valueno = 'no';
    
    $new_messages = bp_get_user_meta_key('notification_messages_new_message' );
    bp_update_user_meta( $user_id, $new_messages, $valueyes );
    
    $new_notices = bp_get_user_meta_key('notification_messages_new_notice' );
    bp_update_user_meta( $user_id, $new_notices, $valueno );
    
    $group_invite = bp_get_user_meta_key('notification_groups_invite' );
    bp_update_user_meta( $user_id, $group_invite, $valueyes );
    
    $group_update = bp_get_user_meta_key('notification_groups_group_updated' );
    bp_update_user_meta( $user_id, $group_update, $valueno );
    
    $group_promo = bp_get_user_meta_key('notification_groups_admin_promotion' );
    bp_update_user_meta( $user_id, $group_promo, $valueyes );
    
    $group_request = bp_get_user_meta_key('notification_groups_membership_request' );
    bp_update_user_meta( $user_id, $group_request, $valueyes );
    
    $mention = bp_get_user_meta_key('notification_activity_new_mention' );
    bp_update_user_meta( $user_id, $mention, $valueyes );
    
    $reply = bp_get_user_meta_key('notification_activity_new_reply' );
    bp_update_user_meta( $user_id, $reply, $valueyes );
    
    $send_requests = bp_get_user_meta_key('notification_friends_friendship_request' );
    bp_update_user_meta( $user_id, $send_requests, $valueyes );
    
    $accept_requests = bp_get_user_meta_key('notification_friends_friendship_accepted' );
    bp_update_user_meta( $user_id, $accept_requests, $valueno );
    do_action( 'bp_core_notification_settings_after_save' );
    
    }
    add_action('bp_core_activated_user', 'set_default_notifications', 10, 3);
Viewing 1 replies (of 1 total)
Skip to toolbar