Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'cron_schedules', 'cron_add_per_minute' );
- function cron_add_per_minute( $schedules ) {
- // Adds once weekly to the existing schedules.
- $schedules['per_minute'] = array(
- 'interval' => 60,
- 'display' => __( 'Per Minute' )
- );
- return $schedules;
- }
- // Create the custom hook for cron scheduler
- add_action( 'kallzu_test_cron_hook', 'kallzu_test_cron' );
- function kallzu_test_cron() {
- echo "working";
- die();
- }
- if( !wp_next_scheduled( 'kallzu_test_cron_hook' ) ) {
- wp_schedule_event( time(), 'per_minute', 'kallzu_test_cron_hook' );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement