Add aria attributes to sensitive content toggle

This commit is contained in:
Tetrakern 2023-01-24 02:23:35 +01:00
parent f2bf5c225d
commit 856b413f6b

View File

@ -127,7 +127,7 @@ if ( ! function_exists( 'fictioneer_chapter_warnings' ) ) {
printf(
_x( 'Warning: %1$s! — You can hide <em>marked</em> sensitive content %2$s or with the %3$s toggle in the %4$s formatting menu. If provided, <em>alternative</em> content will be displayed instead.', 'Chapter warning (1) with sensitive content toggle (2) and icons (3-4).', 'fictioneer' ),
$warning,
'<label id="inline-sensitive-content-toggle" for="reader-settings-sensitive-content-toggle" tabindex="0"><i class="fa-solid off fa-toggle-on"></i><i class="fa-solid on fa-toggle-off"></i> <span>' . _x( 'by clicking here', ' As in hide sensitive content by clicking here.', 'fictioneer' ) . '</span></label>',
'<label id="inline-sensitive-content-toggle" for="reader-settings-sensitive-content-toggle" tabindex="0" aria-role="checkbox" aria-label="' . esc_attr__( 'Toggle sensitive content', 'fictioneer' ) . '"><i class="fa-solid off fa-toggle-on"></i><i class="fa-solid on fa-toggle-off"></i> <span>' . _x( 'by clicking here', ' As in hide sensitive content by clicking here.', 'fictioneer' ) . '</span></label>',
'<i class="fa-solid fa-exclamation-circle"></i>',
fictioneer_get_icon( 'font-settings' )
);