$wpbd->insert_id is returning null

I have been trying to return a $wpdb->insert_id; but unfortunately, it is returning null; That’s not true, you haven’t been returning $wpdb->insert_id at all. // insert $toevoegen = $wpdb->insert( … ); $lastinsertid = $toevoegen->insert_id; You’ve been returning $toevoegen->insert_id, which is wrong. According to the docs $wpdb->insert will return either false or it will return the … Read more

wp_schedule_event not executing function call, even with add_action

Ahg…solved the problem, but why oh why. Ok, the solution is to put the add_action outside the function. function mmd_wpusercleanup_StartProcessingKeepList($nBatch) { $args = array(‘nBatch’ => $nBatch); if (wp_next_scheduled(‘mmd_ProcessKeepBatch’)) wp_clear_scheduled_hook( ‘mmd_ProcessKeepBatch’ ); $Status = wp_schedule_event( current_time(‘timestamp’), ‘MMD_cleanupevent’, ‘mmd_ProcessKeepBatch’, array( $args ) ); } // GOES HERE INSTEAD. add_action( ‘mmd_ProcessKeepBatch’, ‘mmd_wpusercleanup_ProcessKeepBatch’ ); Hopefully this can help someone … Read more