Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
?>
<h3><?php esc_html_e( 'Two-Factor Options', 'two-factor' ); ?></h3>
<h2><?php esc_html_e( 'Two-Factor Options', 'two-factor' ); ?></h2>
<input type="hidden" name="<?php echo esc_attr( self::ENABLED_PROVIDERS_USER_META_KEY ); ?>[]" value="<?php /* Dummy input so $_POST value is passed when no providers are enabled. */ ?>" />
<table class="wp-list-table widefat fixed striped table-view-list two-factor-methods-table">
<thead>
Expand Down
9 changes: 9 additions & 0 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <?php echo wp_json_encode( __( 'Authenticator App QR Code', 'two-factor' ) ); ?>;
title.innerText = svg.ariaLabel;
svg.appendChild( title );
};

// Run now if the document is loaded, otherwise on DOMContentLoaded.
Expand Down