Skip to content

Instantly share code, notes, and snippets.

@dieppon
Last active May 24, 2023 17:09
Show Gist options
  • Save dieppon/e65694c828a99f1eb7a45fdb4b5563a7 to your computer and use it in GitHub Desktop.
Save dieppon/e65694c828a99f1eb7a45fdb4b5563a7 to your computer and use it in GitHub Desktop.
Adds an invisible descriptive text to the CTA button
diff --git a/includes/display.php b/includes/display.php
index 3d0e070..0ab7fa6 100644
--- a/includes/display.php
+++ b/includes/display.php
@@ -170,7 +170,7 @@ class ANCR_Display{
$attrs[ 'rel' ] = 'nofollow noreferrer';
}
- $html .= '<a ' . ANCR_Utilities::build_attrs( $attrs ) . '>' . wp_kses_post( $button[ 'text' ] ) . '</a>';
+ $html .= '<a ' . ANCR_Utilities::build_attrs( $attrs ) . '>' . wp_kses_post( $button[ 'text' ] ) . ($button[ 'title' ] ? '<span class="visually-hidden"> ' . $button[ 'title' ] . '</span>' : '') .'</a>';
}
$html .= '</div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment