fix: harden CHRNX shell accessibility

This commit is contained in:
chrnx committed 2026-08-11 17:12:18 -05:00
1 parent f371db4cb5
commit e1579657d6
14 files changed
+520 -54

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
<?php
/**
* Render the progressive mobile navigation toggle.
*
* @package CHRNX
*/
$chrnx_open_label = __( 'Open primary navigation', 'chrnx' );
$chrnx_close_label = __( 'Close primary navigation', 'chrnx' );
?>
<button
<?php
// WordPress escapes each generated wrapper attribute.
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo get_block_wrapper_attributes(
array(
'class' => 'chrnx-mobile-menu-toggle',
'data-chrnx-menu-toggle' => '',
)
);
?>
type="button"
hidden
aria-controls="chrnx-primary-navigation"
aria-expanded="false"
aria-label="<?php echo esc_attr( $chrnx_open_label ); ?>"
data-label-open="<?php echo esc_attr( $chrnx_open_label ); ?>"
data-label-close="<?php echo esc_attr( $chrnx_close_label ); ?>"
>
<span aria-hidden="true">☰</span>
</button>