| @@ -19,8 +19,9 @@ | ||
| 19 | 19 | $off_label = isset( $args['off_label'] ) ? $args['off_label'] : ''; |
| 20 | 20 | $on_label = isset( $args['on_label'] ) ? $args['on_label'] : 1; |
| 21 | 21 | $value = isset( $args['value'] ) ? $args['value'] : $on_label; |
| 22 | 22 | $checked = isset( $args['checked'] ) && ( true === $args['checked'] || false !== strpos( $args['checked'], 'checked="checked"' ) ); |
| 23 | +$disabled = ! empty( $args['disabled'] ); | |
| 23 | 24 | $aria_checked = $checked ? 'true' : 'false'; |
| 24 | 25 | $input_html = isset( $args['input_html'] ) ? $args['input_html'] : array(); |
| 25 | 26 | |
| 26 | 27 | $use_container = false; |
| @@ -55,8 +56,11 @@ | ||
| 55 | 56 | <?php checked( $checked, true ); ?> |
| 56 | 57 | <?php if ( $show_labels && $off_label ) { ?> |
| 57 | 58 | data-off="<?php echo esc_attr( $off_label ); ?>" |
| 58 | 59 | <?php } ?> |
| 60 | + <?php if ( $disabled ) { ?> | |
| 61 | + disabled | |
| 62 | + <?php } ?> | |
| 59 | 63 | <?php |
| 60 | 64 | if ( is_array( $input_html ) ) { |
| 61 | 65 | FrmAppHelper::array_to_html_params( $input_html, true ); |
| 62 | 66 | } else { |
| @@ -64,9 +68,13 @@ | ||
| 64 | 68 | } |
| 65 | 69 | ?> |
| 66 | 70 | /> |
| 67 | 71 | |
| 68 | - <span class="frm_toggle" tabindex="0" role="switch" aria-labelledby="<?php echo esc_attr( $id ); ?>_label" aria-checked="<?php echo esc_attr( $aria_checked ); ?>"> | |
| 72 | + <span class="frm_toggle" tabindex="0" role="switch" | |
| 73 | + <?php echo ! empty( $args['aria-label-attr'] ) ? 'aria-label="' . esc_attr( $args['aria-label-attr'] ) . '"' : ''; ?> | |
| 74 | + aria-labelledby="<?php echo esc_attr( $id ); ?>_label" | |
| 75 | + aria-checked="<?php echo esc_attr( $aria_checked ); ?>" | |
| 76 | + > | |
| 69 | 77 | <span class="frm_toggle_slider"></span> |
| 70 | 78 | </span> |
| 71 | 79 | |
| 72 | 80 | <?php if ( $show_labels && $on_label != 1 ) { ?> |