wp_schedule_event with dynamic names but same function
This is what the 4th parameter, $args is for. Use a single name for the event and pass the unique name as an argument. public function schedule($interval, $event): void { $args = array($event); if (! \wp_next_scheduled(‘my_scheduled_event’, $args)) { \wp_schedule_event(time(), $interval, ‘my_scheduled_event’, $args); } } Then you can have a single callback function that has access … Read more