| @@ -8,8 +8,10 @@ | ||
| 8 | 8 | add_action( 'woocommerce_admin_field_' . self::FIELD_TYPE, array( $this, 'render' ) ); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | public function render( $value ) { |
| 12 | + // the description is plugin-defined text (settings arrays), read once for output | |
| 13 | + $description = (string) ( $value['desc'] ?? '' ); | |
| 12 | 14 | if ( ! isset( $value['id'] ) ) { |
| 13 | 15 | $value['id'] = ''; |
| 14 | 16 | } |
| 15 | 17 | |
| @@ -31,9 +33,9 @@ | ||
| 31 | 33 | <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label> |
| 32 | 34 | </th> |
| 33 | 35 | <td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>"> |
| 34 | 36 | |
| 35 | - <div style="display: flex; gap:20px; align-items: end; flex-wrap: wrap;"> | |
| 37 | + <div style="display: flex; gap:0 20px; align-items: end; flex-wrap: wrap;"> | |
| 36 | 38 | <?php foreach ( $value['options'] as $option ) : ?> |
| 37 | 39 | <?php |
| 38 | 40 | $option['value'] = get_option( $option['id'], $option['default'] ) |
| 39 | 41 | ?> |
| @@ -48,13 +50,14 @@ | ||
| 48 | 50 | id="<?php echo esc_attr( $option['id'] ); ?>" |
| 49 | 51 | placeholder=""> |
| 50 | 52 | </div> |
| 51 | 53 | <?php endforeach; ?> |
| 52 | - | |
| 54 | + <div style="width: 100%; height:0"></div> | |
| 55 | + <div> | |
| 56 | + <p class="description"><?php echo wp_kses_post( $description ); // nosemgrep ?></p> | |
| 57 | + </div> | |
| 53 | 58 | <?php do_action( 'tiered_pricing_table/settings/table_columns/after_fields' ); ?> |
| 54 | 59 | </div> |
| 55 | - | |
| 56 | - <p class="description"><?php echo wp_kses_post( $value['desc'] ); ?></p> | |
| 57 | 60 | |
| 58 | 61 | <?php do_action( 'tiered_pricing_table/settings/table_columns/end' ); ?> |
| 59 | 62 | </td> |
| 60 | 63 | </tr> |