| @@ -17,8 +17,11 @@ | ||
| 17 | 17 | }, 10, 3 ); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function render( $value ) { |
| 21 | + // the description is plugin-defined text (settings arrays), read once for output | |
| 22 | + $description = (string) ( $value['desc'] ?? '' ); | |
| 23 | + $extendedDescription = (string) ( $value['extended_description'] ?? '' ); | |
| 21 | 24 | if ( ! isset( $value['id'] ) ) { |
| 22 | 25 | $value['id'] = ''; |
| 23 | 26 | } |
| 24 | 27 | |
| @@ -72,13 +75,12 @@ | ||
| 72 | 75 | <span data-tpt-toggle-switch-on><?php echo esc_attr( $value['on_label'] ); ?></span> |
| 73 | 76 | <span data-tpt-toggle-switch-off><?php echo esc_attr( $value['off_label'] ); ?></span> |
| 74 | 77 | </label> |
| 75 | 78 | </div> |
| 76 | - <p class="description"><?php echo wp_kses_post( $value['desc'] ); ?></p> | |
| 77 | - | |
| 79 | + <p class="description"><?php echo wp_kses_post( $description ); // nosemgrep ?></p> | |
| 78 | 80 | <?php if ( isset( $value['extended_description'] ) ) : ?> |
| 79 | 81 | <div class="tpt-toggle-extended-description"> |
| 80 | - <?php echo wp_kses_post( $value['extended_description'] ); ?> | |
| 82 | + <?php echo wp_kses_post( $extendedDescription ); // nosemgrep ?> | |
| 81 | 83 | </div> |
| 82 | 84 | <?php endif; ?> |
| 83 | 85 | </td> |
| 84 | 86 | </tr> |