• Resolved jeng22

    (@jeng22)


    Great plugin, works fine for me. I just want to tweak it a little. I want to limit the users to send an entry once a day only. I have set the unique identifier to their email. Any tips on how to approach this? Thanks.

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

    (@jeng22)

    Figured something out using CRON jobs. Here’s how I did it for those who want the same setup 🙂

    1. in your functions.php –

    /* CONTACT FORM DUPLICATE ENTRIES CRON JOB */
    function delete_all_duplicate_killer_data() {
        global $wpdb;
        $dkdb = apply_filters('duplicate_killer_database', $wpdb);
        $table_name = $dkdb->prefix . 'dk_forms_duplicate';
    
        // Delete all records from the database table
        $dkdb->query("TRUNCATE TABLE $table_name");
    }
    
    // Hook the function to a custom action hook
    add_action('delete_all_duplicate_killer_data_hook', 'delete_all_duplicate_killer_data');

    2. Install “WP Crontrol” and then add new Cron event with the following values –
    Hook name: delete_all_duplicate_killer_data_hook
    arguments: leave blank
    Next run: up to you. But I did “At this time:” with 12am and “Once Daily” recurrence.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.