| @@ -19,11 +19,20 @@ | ||
| 19 | 19 | * |
| 20 | 20 | * @return void |
| 21 | 21 | */ |
| 22 | 22 | public function render( $field_settings, $form_id ) { |
| 23 | + /** | |
| 24 | + * Ensure the field name is set. There have been cases where the name array key is not set. | |
| 25 | + * Not sure why and we were unable to replicate without manually removing the key. | |
| 26 | + * This is a failsafe to ensure the field name is set. | |
| 27 | + */ | |
| 28 | + if ( ! isset( $field_settings['name'] ) ) { | |
| 29 | + $field_settings['name'] = 'custom_html'; | |
| 30 | + } | |
| 31 | + $use_theme_css = isset( $form_settings['use_theme_css'] ) ? $form_settings['use_theme_css'] : 'wpuf-style'; | |
| 23 | 32 | ?> |
| 24 | 33 | <li <?php $this->print_list_attributes( $field_settings ); ?>> |
| 25 | - <div class="wpuf-fields <?php echo 'html_' . esc_attr( $form_id ); ?><?php echo ' wpuf_'. esc_attr( $field_settings['name'] ).'_'. esc_attr( $form_id ); ?>"> | |
| 34 | + <div class="wpuf-fields <?php echo 'html_' . esc_attr( $form_id ); ?><?php echo ' wpuf_'. esc_attr( $field_settings['name'] ).'_'. esc_attr( $form_id ); ?>" data-style="<?php echo esc_attr( $use_theme_css ); ?>"> | |
| 26 | 35 | <?php echo $field_settings['html']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?> |
| 27 | 36 | </div> |
| 28 | 37 | |
| 29 | 38 | </li> |