Skip to content

Instantly share code, notes, and snippets.

@talentedaamer
Last active July 31, 2018 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talentedaamer/374c25dc73cc6f0c8884146593d4c896 to your computer and use it in GitHub Desktop.
Save talentedaamer/374c25dc73cc6f0c8884146593d4c896 to your computer and use it in GitHub Desktop.
Create new schedule times via 'cron_schedules' filter hook
<?php
// using 30min time interval
wp_schedule_event( time(), '30min', 'wptc_custom_schedule_hook', $args );
// using weekly time interval
wp_schedule_event( time(), 'weekly', 'wptc_custom_schedule_hook', $args );
// using monthly time interval
wp_schedule_event( time(), 'montly', 'wptc_custom_schedule_hook', $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment