32 lines
832 B
PHP
32 lines
832 B
PHP
<?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>
|