Skip to content

Commit

Permalink
Merge pull request #650 from equalizedigital/steve/629/open-in-new-wi…
Browse files Browse the repository at this point in the history
…ndow-phrases

Updated link_blank rule allowed phrases
  • Loading branch information
SteveJonesDev committed May 30, 2024
2 parents 2d2078c + 386b7a1 commit b18ae20
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions includes/rules/link_blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,11 @@ function edac_check_link_blank_text( $text ) {

$text = strtolower( $text );

// phrases.
$allowed_phrases = [
__( 'opens a new window', 'accessibility-checker' ),
__( 'opens a new tab', 'accessibility-checker' ),
__( 'opens new window', 'accessibility-checker' ),
__( 'opens new tab', 'accessibility-checker' ),
__( 'new window', 'accessibility-checker' ),
__( 'new tab', 'accessibility-checker' ),
];

// check if text contains any of the allowed phrases.
foreach ( $allowed_phrases as $allowed_phrase ) {
if ( strpos( $text, $allowed_phrase ) !== false ) {
return true;
Expand Down

0 comments on commit b18ae20

Please sign in to comment.