• The plugin works, but when you have html in the CF7 form code, it doesn’t detect the field name correctly and it looks like this – https://postimg.cc/K1ZFfNjQ The problem is that when you click the checkbox, it saves it and duplicate checks works, but after reload the settings page, checkbox is not active, it is unchecked, and when you save the settings again, you actually deactivate the duplicate check function for the field.

Viewing 1 replies (of 1 total)
  • Thread Starter Sonjoe

    (@sonjoe)

    I found out that this might be the reason how the function retrieves the tag names. I modified some code in functions_cf7.php, and although the list no longer displays the tag names in square brackets (it now shows them without brackets), the function works as expected. Additionally, the checkbox remains checked after refreshing or resaving the settings page, so you won’t accidentally uncheck the fields.

    function duplicate_killer_CF7_get_forms(){
    global $wpdb;
    $CF7Query = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'wpcf7_contact_form'", ARRAY_A );

    if ($CF7Query == NULL) {
    return false;
    } else {
    $output = array();
    foreach ($CF7Query as $form) {
    preg_match_all('/\[(text|email|tel)[^\]]*\s+([a-z0-9-_]+)/i', $form['post_content'], $matches);
    foreach ($matches[2] as $match) {
    $output[$form['post_title']][] = $match;
    }
    }
    return $output;
    }
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.