$html .= $closing_tag;
// if previous iteration was diferent class close p
- } elseif ($i != 0 && array_map('trim', explode(",", $this->str_val_or_empty($data[$i - 1], 'class'))) != $class) {
- [$closing_tag, $is_p_closed] = $this->open_or_close_p($is_p_closed, $class, CLOSE);
- $html .= $closing_tag;
+ } elseif ($i != 0 && empty($url)) { // need to check if url is empty cause if not then the classes will go in the a tag
+ if (empty($this->str_val_or_empty($data[$i - 1], 'url')) && array_map('trim', explode(",", $this->str_val_or_empty($data[$i - 1], 'class'))) != $class) {
+ [$closing_tag, $is_p_closed] = $this->open_or_close_p($is_p_closed, $class, CLOSE);
+ $html .= $closing_tag;
+ }
}
$html .= $this->form_h2_title($data, $i, $section, $url, $title, $class);