Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. add_filter( 'cron_schedules', 'cron_add_per_minute' );
  2. function cron_add_per_minute( $schedules ) {
  3. // Adds once weekly to the existing schedules.
  4. $schedules['per_minute'] = array(
  5. 'interval' => 60,
  6. 'display' => __( 'Per Minute' )
  7. );
  8. return $schedules;
  9. }
  10.  
  11. // Create the custom hook for cron scheduler
  12. add_action( 'kallzu_test_cron_hook', 'kallzu_test_cron' );
  13. function kallzu_test_cron() {
  14. echo "working";
  15. die();
  16. }
  17.  
  18. if( !wp_next_scheduled( 'kallzu_test_cron_hook' ) ) {
  19. wp_schedule_event( time(), 'per_minute', 'kallzu_test_cron_hook' );
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement