Skip to content

Commit

Permalink
Apply keyboard layout setting to the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jul 19, 2023
1 parent e079004 commit 2c8a170
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions piano-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function piano_block_render_callback( $attributes ) {
$octave_offset = ! empty( $attributes['octaveOffset'] ) ? min( max( (int) $attributes['octaveOffset'], -2 ), 2 ) : 0;
$instrument = ! empty( $attributes['instrument'] ) ? $attributes['instrument'] : 'acoustic-piano';
$synthesizer_setting = ! empty( $attributes['synthesizerSetting'] ) ? $attributes['synthesizerSetting'] : array();
$key_layout = ! empty( $attributes['keyLayout'] ) ? $attributes['keyLayout'] : 'qwerty-1';

wp_enqueue_style( 'wp-components' );

Expand All @@ -56,6 +57,7 @@ function piano_block_render_callback( $attributes ) {
'octaveOffset' => $octave_offset,
'instrument' => $instrument,
'synthesizerSetting' => $synthesizer_setting,
'keyLayout' => $key_layout,
),
)
);
Expand Down

0 comments on commit 2c8a170

Please sign in to comment.