Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/02/2017 07:46:47 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Mentions: Add classes and basic styling to mention clickable callback.

Fixes #3074. See #meta-2542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/formatting.php

    r6336 r6346  
    464464
    465465/**
    466  * Callback to convert mention matchs to HTML A tag.
     466 * Callback to convert mention matches to HTML A tag.
    467467 *
    468468 * @since 2.6.0 (r6014)
     
    480480        }
    481481
     482        // Filter classes
     483        $classes = apply_filters( 'bbp_make_mentions_clickable_classes', array(
     484                'bbp-user-id-' . $user->ID,
     485                'bbp-user-mention'
     486        ) );
     487
    482488        // Create the link to the user's profile
    483489        $url    = bbp_get_user_profile_url( $user->ID );
    484         $anchor = sprintf( '<a href="%1$s">@%2$s</a>', esc_url( $url ), esc_html( $user->user_nicename ) );
     490        $clicky = '<a href="%1$s" class="' . implode( ' ', array_map( 'esc_attr', $classes ) ) . '">@%2$s</a>';
     491        $anchor = sprintf( $clicky, esc_url( $url ), esc_html( $user->user_nicename ) );
    485492        $link   = bbp_rel_nofollow( $anchor );
    486493
Note: See TracChangeset for help on using the changeset viewer.