$args Optional. Arguments passed to the hook. Default empty. * @return bool True when a run is scheduled at or before `$timestamp` afterwards. */ public static function schedule_at( string $hook, int $timestamp, array $args = array() ): bool { $scheduled = wp_next_scheduled( $hook, $args ); if ( false !== $scheduled ) { if ( $scheduled <= $timestamp ) { return true; } wp_unschedule_event( $scheduled, $hook, $args ); } return true === wp_schedule_single_event( $timestamp, $hook, $args ); } }