Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/22/2017 08:09:27 PM (7 years ago)
Author:
djpaul
Message:

HTML <a> elements should never have title attributes.

Accessible support is too inconsistent across software and platforms.
In a small number of places (mainly legacy templates) where the link text was a meaningless value, the attribute was swapped out for aria-label, which reliably overides the link text readout.

Props rianrietveld

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-list-table.php

    r11414 r11606  
    593593                $actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', __( 'Reply', 'buddypress' ) );
    594594            } else {
    595                 $actions['reply'] = sprintf( '<span class="form-input-tip" title="%s">%s</span>', __( 'Replies are disabled for this activity item', 'buddypress' ), __( 'Replies disabled', 'buddypress' ) );
     595                $actions['reply'] = sprintf( '<span class="form-input-tip">%s</span>', __( 'Replies disabled', 'buddypress' ) );
    596596            }
    597597
     
    707707            // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble.
    708708            if ( $comment_count ) {
    709                 $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) );
    710                 printf( '<a href="%1$s" title="%2$s" class="post-com-count post-com-count-approved"><span class="comment-count comment-count-approved">%3$s</span></a>', esc_url( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
     709                printf( '<a href="%1$s" class="post-com-count post-com-count-approved"><span class="comment-count comment-count-approved">%2$s</span></a>', esc_url( $root_activity_url ), number_format_i18n( $comment_count ) );
    711710            }
    712711
Note: See TracChangeset for help on using the changeset viewer.