Skip to:
Content

BuddyPress.org

Changeset 12269


Ignore:
Timestamp:
11/02/2018 12:39:53 PM (2 years ago)
Author:
djpaul
Message:

Activity: consolidate secondary activity avatar and name into one link.

Per WCAG guidelines, these should be a single link.
See https://www.w3.org/TR/2014/NOTE-WCAG20-TECHS-20140311/H2

Fixes #7963

Thanks to dcavins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/activity/functions.php

    r12156 r12269  
    359359        case 'groups':
    360360        case 'friends':
     361            $secondary_avatar = bp_get_activity_secondary_avatar( array( 'linked' => false ) );
     362
    361363            // Only insert avatar if one exists.
    362             if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) {
    363                 $reverse_content = strrev( $action );
    364                 $position        = strpos( $reverse_content, 'a<' );
    365                 $action          = substr_replace( $action, $secondary_avatar, -$position - 2, 0 );
     364            if ( $secondary_avatar ) {
     365                $link_close  = '">';
     366                $first_link  = strpos( $action, $link_close );
     367                $second_link = strpos( $action, $link_close, $first_link + strlen( link_close ) );
     368                $action      = substr_replace( $action, $secondary_avatar, $second_link + 2, 0 );
    366369            }
    367370            break;
Note: See TracChangeset for help on using the changeset viewer.