block.json
1 year ago
index.asset.php
1 month ago
index.js
1 month ago
style-index-rtl.css
1 year ago
style-index.css
1 year ago
view.php
1 year ago
view.php
54 lines
| 1 | <?php |
| 2 | $buttons = array( |
| 3 | array( |
| 4 | 'class' => 'sc-sidebar-toggle-desktop', |
| 5 | 'event' => 'actions.toggleDesktop', |
| 6 | 'ariaLabel' => 'state.ariaLabelDesktop', |
| 7 | ), |
| 8 | array( |
| 9 | 'class' => 'sc-sidebar-toggle-mobile', |
| 10 | 'event' => 'actions.toggleMobile', |
| 11 | 'ariaLabel' => 'state.ariaLabelMobile', |
| 12 | ), |
| 13 | ); |
| 14 | ?> |
| 15 | |
| 16 | <?php foreach ( $buttons as $button ) : ?> |
| 17 | <div |
| 18 | <?php |
| 19 | echo wp_kses_data( |
| 20 | get_block_wrapper_attributes( |
| 21 | array( |
| 22 | 'class' => $button['class'], |
| 23 | ) |
| 24 | ) |
| 25 | ); |
| 26 | ?> |
| 27 | data-wp-interactive='{ "namespace": "surecart/sidebar" }' |
| 28 | data-wp-on--click="<?php echo esc_attr( $button['event'] ); ?>" |
| 29 | data-wp-on--keydown="<?php echo esc_attr( $button['event'] ); ?>" |
| 30 | aria-haspopup="dialog" |
| 31 | data-wp-bind--aria-label="<?php echo esc_attr( $button['ariaLabel'] ); ?>" |
| 32 | role="button" |
| 33 | tabindex="0" |
| 34 | > |
| 35 | <?php |
| 36 | echo ! empty( $attributes['icon'] ) && 'none' !== $attributes['icon'] ? wp_kses( |
| 37 | SureCart::svg()->get( |
| 38 | $attributes['icon'], |
| 39 | [ |
| 40 | 'aria-label' => __( |
| 41 | 'Open sidebar', |
| 42 | 'surecart' |
| 43 | ), |
| 44 | 'class' => 'sc-sidebar-toggle__icon', |
| 45 | ], |
| 46 | ), |
| 47 | sc_allowed_svg_html() |
| 48 | ) : ''; |
| 49 | |
| 50 | echo wp_kses_post( $attributes['label'] ?? __( 'Filter', 'surecart' ) ); |
| 51 | ?> |
| 52 | </div> |
| 53 | <?php endforeach; ?> |
| 54 |