multiple record insert creating many duplicate records

For running in WP cron, you’ll define your function, and then hook the function to the cron’s name. Example: function cron_function() { … } add_action( ‘cron_hook’, ‘cron_function’ ); if ( ! wp_next_scheduled( ‘cron_hook’ ) ) { wp_schedule_event( time(), ‘one_minute’, ‘cron_hook’ ); } See WordPress developer resource for more info: https://developer.wordpress.org/plugins/cron/scheduling-wp-cron-events/

Sharing plugin tables between 2 sites in the same database

I’ve created an alternative wp-config.php and renamed to wp-config2.php with the same configuration except for the table prefix. Then I tried by editing all the plugin files. At the top of each file I found: if ( ! defined( ‘ABSPATH’ ) ) { exit; // Exit if accessed directly! } And I replaced it for: … Read more

Can’t save formdata in DB

You must define the checkbox to store array in order to get all the selected values. Change your input name from “data-ids” to “data-ids[]”. <input name=”data_ids[]” value=”<?php echo get_the_ID(); ?>” <?= isset($results[get_the_ID()]->data_id) == get_the_ID() ? ‘checked’ : ” ?> type=”checkbox” />