Skip to:
Content

BuddyPress.org

Changeset 10958


Ignore:
Timestamp:
07/24/2016 01:08:51 PM (5 years ago)
Author:
djpaul
Message:

Activity, Mentions: add CSS class to inserted mentions for theme devs to style.

For legacy reasons which probably need addressing sometime, we store the at-mentions expanded in the DB (i.e. linked in anchor tags), so just adding the class here won't affect existing activity content, only new content. But, it provides an opportunity for future consistency as we add other mention types.

Fixes #5765

File:
1 edited

Legend:

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

    r10860 r10958  
    279279    // Linkify the mentions with the username.
    280280    foreach ( (array) $usernames as $user_id => $username ) {
    281         $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
     281        $content = preg_replace( '/(@' . $username . '\b)/', "<a class='bp-suggestions-mention' href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
    282282    }
    283283
     
    320320        // Replace @mention text with userlinks.
    321321        foreach( (array) $usernames as $user_id => $username ) {
    322             $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content );
     322            $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a class='bp-suggestions-mention' href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content );
    323323        }
    324324
Note: See TracChangeset for help on using the changeset viewer.