Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/24/2011 12:33:51 PM (15 years ago)
Author:
djpaul
Message:

Fix at-notifications to work when BP_ENABLE_USERNAME_COMPATIBILITY_MODE is not set and user_nicename != user_login

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-filters.php

    r4259 r4277  
    117117
    118118        foreach( (array)$usernames as $username ) {
    119                 if ( !$user_id = username_exists( $username ) )
     119                if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) )
     120                        $user_id = username_exists( $username );
     121                else
     122                        $user_id = bp_core_get_userid_from_nicename( $username );
     123
     124                if ( empty( $user_id ) )
    120125                        continue;
    121126
    … …  
    124129                update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
    125130
    126                 $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
     131                $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
    127132        }
    128133
Note: See TracChangeset for help on using the changeset viewer.