Custom tag broke with new update
-
Hello there,
I have the following code and with the new update the tag stopped working. I dont understand what is going on. Any help is appreciated.
add_action('wpcf7_init', 'custom_form_tag_qty'); function custom_form_tag_qty() { wpcf7_add_form_tag(array('qty'), 'custom_qty_form_tag_handler', true); } function custom_qty_generate_input_unique_name($init, $tab, $row, $field) { return $init . '____' . $tab . '____' . $row . '____' . $field; } function custom_qty_form_tag_handler($tag) { $tag = new WPCF7_FormTag($tag); $atts = array(); $atts['id'] = $tag->get_id_option(); $atts['name'] = $tag->name; $atts = wpcf7_format_atts($atts); $myCustomField = ' <div class="row b2b__info-table-title"> <div class="col-7"> <div class="b2b__info-table-cell font-noto">' . $tag->raw_values[2] . '</div> </div> <div class="col-5"> <div class="b2b__info-table-cell font-noto">'.__('Ποσότητα', 'theme-name').'</div> </div> </div> <div class="row b2b__info-table-data"> '; foreach ($tag->raw_values as $key => $value) { if ($key > 2) { $myCustomField .= ' <div class="col-7"> <div class="b2b__info-table-cell">' . $value . '</div> </div> <div class="col-5"> <div class="b2b__info-table-cell"> <div class="b2b__input-container"> <div class="b2b__input-minus">-</div> <input type="number" class="b2b__input" value="0" name="' . custom_qty_generate_input_unique_name($tag->raw_values[0], $tag->raw_values[1], $tag->raw_values[2], $value) . '" min="0" max="999"> <div class="b2b__input-plus">+</div> </div> </div> </div> '; } } $myCustomField .= '</div>'; return $myCustomField; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Custom tag broke with new update’ is closed to new replies.