footer
4 years ago
sui-accordion.php
4 years ago
sui-box-header.php
5 years ago
sui-button.php
4 years ago
sui-checkbox.php
5 years ago
sui-footer.php
5 years ago
sui-header.php
5 years ago
sui-icon.php
5 years ago
sui-notice.php
5 years ago
sui-row.php
5 years ago
sui-select.php
5 years ago
sui-settings-row.php
5 years ago
sui-tabs.php
5 years ago
sui-tutorials.php
4 years ago
sui-settings-row.php
88 lines
| 1 | <?php |
| 2 | /** |
| 3 | * SUI Settings Row |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.3.0 |
| 7 | * |
| 8 | * @phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped |
| 9 | */ |
| 10 | |
| 11 | $vanilla_hide = ( isset( $vanilla_hide ) ) ? $vanilla_hide : false; |
| 12 | $label_tag = ( isset( $label_tag ) && ! empty( $label_tag ) ) ? $label_tag : 'h3'; |
| 13 | $has_label = ( isset( $label ) && ! empty( $label ) ) ? true : false; |
| 14 | $has_description = ( isset( $description ) && ! empty( $description ) ) ? true : false; |
| 15 | $has_multiline_description = ( isset( $multi_description ) && ! empty( $multi_description ) ) ? true : false; |
| 16 | $description_class = ( isset( $label ) ) ? 'hustle-' . sanitize_title( $label ) . '-elements-row' : ''; |
| 17 | ?> |
| 18 | |
| 19 | <?php |
| 20 | printf( |
| 21 | '<div class="sui-box-settings-row %s"%s>', |
| 22 | $description_class, |
| 23 | $vanilla_hide ? ' data-toggle-content="use-vanilla"' : '' |
| 24 | ); |
| 25 | ?> |
| 26 | |
| 27 | <?php if ( $has_label || $has_multiline_description || $has_description ) { ?> |
| 28 | |
| 29 | <div class="sui-box-settings-col-1"> |
| 30 | |
| 31 | <?php |
| 32 | if ( $has_label ) { |
| 33 | |
| 34 | switch ( $label_tag ) { |
| 35 | |
| 36 | case 'h3': |
| 37 | echo '<h3 class="sui-settings-label">' . $label . '</h3>'; |
| 38 | break; |
| 39 | |
| 40 | case 'h4': |
| 41 | echo '<h4 class="sui-settings-label">' . $label . '</h4>'; |
| 42 | break; |
| 43 | |
| 44 | case 'h5': |
| 45 | echo '<h5 class="sui-settings-label">' . $label . '</h5>'; |
| 46 | break; |
| 47 | |
| 48 | case 'h6': |
| 49 | echo '<h6 class="sui-settings-label">' . $label . '</h6>'; |
| 50 | break; |
| 51 | |
| 52 | case 'p': |
| 53 | echo '<p class="sui-settings-label">' . $label . '</p>'; |
| 54 | break; |
| 55 | |
| 56 | default: |
| 57 | echo '<h2 class="sui-settings-label">' . $label . '</h2>'; |
| 58 | break; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | if ( $has_multiline_description ) { |
| 63 | |
| 64 | $paragraph = ''; |
| 65 | |
| 66 | foreach ( $multi_description as $k => $description ) { |
| 67 | $paragraph .= '<p class="sui-description">' . $description . '</p>'; |
| 68 | } |
| 69 | |
| 70 | echo $paragraph; |
| 71 | |
| 72 | } elseif ( $has_description ) { |
| 73 | echo '<p class="sui-description">' . $description . '</p>'; |
| 74 | } |
| 75 | ?> |
| 76 | |
| 77 | </div> |
| 78 | |
| 79 | <?php } ?> |
| 80 | |
| 81 | <div class="sui-box-settings-col-2"> |
| 82 | |
| 83 | <?php echo $content; ?> |
| 84 | |
| 85 | </div> |
| 86 | |
| 87 | </div> |
| 88 |