Looking for a better way to initiate cron job
Simply check if the event is scheduled, and if not, schedule it: add_action( ‘init’, function () { if ( ! wp_next_scheduled( ‘my_scheduled_event’ ) ) { wp_schedule_event( time(), ‘hourly’, ‘my_scheduled_event’ ); } } );