diff --git a/class-two-factor-core.php b/class-two-factor-core.php index 62e4019f..82b42d96 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1721,7 +1721,7 @@ public static function user_two_factor_options( $user ) { wp_nonce_field( 'user_two_factor_options', '_nonce_user_two_factor_options', false ); ?> -

+

diff --git a/providers/class-two-factor-totp.php b/providers/class-two-factor-totp.php index 4b075495..88f743db 100644 --- a/providers/class-two-factor-totp.php +++ b/providers/class-two-factor-totp.php @@ -318,6 +318,15 @@ public function user_two_factor_options( $user ) { qr.make(); document.querySelector( '#two-factor-qr-code a' ).innerHTML = qr.createSvgTag( 5 ); + + // For accessibility, markup the SVG with a title and role. + var svg = document.querySelector( '#two-factor-qr-code a svg' ), + title = document.createElement( 'title' ); + + svg.role = 'image'; + svg.ariaLabel = ; + title.innerText = svg.ariaLabel; + svg.appendChild( title ); }; // Run now if the document is loaded, otherwise on DOMContentLoaded.