alert.php
1 week ago
button.php
1 week ago
confirm.php
1 week ago
dialog.php
1 week ago
modal.php
1 week ago
button.php
47 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Dialog Button Template |
| 4 | * The button template for Tribe Dialog trigger. |
| 5 | * |
| 6 | * Override this template in your own theme by creating a file at [your-theme]/tribe/dialogs/button.php |
| 7 | * |
| 8 | * @since 4.10.0 |
| 9 | * @since 4.12.15 Add data attributes to the button. |
| 10 | * @since 4.12.15 Don't render template if `$button_display` is set to false. |
| 11 | * @since 4.12.17 Allow having basic HTMl within the button content so we can add elements with texts for a11y. |
| 12 | * |
| 13 | * @package Tribe |
| 14 | * @version 4.12.17 |
| 15 | */ |
| 16 | |
| 17 | if ( empty( $button_display ) ) { |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | $classes = $button_classes ?: 'tribe-button'; |
| 22 | $classes = implode( ' ', (array) $classes ); |
| 23 | $attributes = $button_attributes ?: []; |
| 24 | |
| 25 | ?> |
| 26 | <button |
| 27 | class="<?php echo esc_attr( $classes ); ?>" |
| 28 | <?php tribe_attributes( $attributes ); ?> |
| 29 | data-content="<?php echo esc_attr( 'dialog-content-' . $id ); ?>" |
| 30 | data-js="<?php echo esc_attr( 'trigger-dialog-' . $id ); ?>" |
| 31 | <?php if ( ! empty( $button_id ) ) : ?> |
| 32 | id="<?php echo esc_attr( $button_id ); ?>" |
| 33 | <?php endif; ?> |
| 34 | <?php if ( ! empty( $button_name ) ) : ?> |
| 35 | name="<?php echo esc_attr( $button_name ); ?>" |
| 36 | <?php endif; ?> |
| 37 | <?php if ( ! empty( $button_type ) ) : ?> |
| 38 | type="<?php echo esc_attr( $button_type ); ?>" |
| 39 | <?php endif; ?> |
| 40 | <?php if ( ! empty( $button_value ) && 0 !== absint( $button_value ) ) : ?> |
| 41 | value="<?php echo esc_attr( $button_value ); ?>" |
| 42 | <?php endif; ?> |
| 43 | <?php if ( ! empty( $button_disabled ) && tribe_is_truthy( $button_disabled ) ) : ?> |
| 44 | <?php tribe_disabled( true ); ?> |
| 45 | <?php endif; ?> |
| 46 | ><?php echo wp_kses_post( $button_text ); ?></button> |
| 47 |