Skip to content

Commit 0510deb

Browse files
committed
updated: capitalize landmark names in aria labels and links for improved accessibility
1 parent de8ca07 commit 0510deb

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

admin/class-ajax.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,13 +481,11 @@ function ( $a, $b ) {
481481
);
482482

483483
// translators: %s is the landmark type (e.g., "Header", "Navigation", "Main").
484-
$landmark_aria_label = sprintf( __( 'View %s landmark on website, opens a new window', 'accessibility-checker' ), $landmark );
484+
$landmark_aria_label = sprintf( __( 'View %s landmark on website, opens a new window', 'accessibility-checker' ), ucwords( $landmark ) );
485485
// translators: %s is the landmark type (e.g., "Header", "Navigation", "Main").
486-
$html .= '<a href="' . $landmark_url . '" class="edac-details-rule-records-record-landmark-link" target="_blank" aria-label="' . esc_attr( $landmark_aria_label ) . '" title="' . esc_attr( sprintf( __( 'Click to highlight the %s landmark on the page', 'accessibility-checker' ), $landmark ) ) . '">' . $landmark . '</a>';
486+
$html .= '<a href="' . $landmark_url . '" class="edac-details-rule-records-record-landmark-link" target="_blank" aria-label="' . esc_attr( $landmark_aria_label ) . '">' . ucwords( $landmark ) . '</a>';
487487
} elseif ( $landmark ) {
488-
$html .= $landmark;
489-
} else {
490-
$html .= '<span class="edac-no-landmark">—</span>';
488+
$html .= ucwords( $landmark );
491489
}
492490

493491
$html .= '</div>';

0 commit comments

Comments
 (0)