0
    add_action('init', 'property_listing_check_status');
function property_listing_check_status() {
    if (! wp_next_scheduled ( 'daily_check_property_status' )) {
    wp_schedule_event( time() , 'hourly', 'daily_check_property_status');
    }
    add_action('daily_check_property_status', 'do_this_hourly');
}



function do_this_hourly() {
    print_r('vivek');
}

I tried this code but i need to change time interval how to change this

1
  • Just change "hourly" to what you need
    – kero
    Jun 20, 2017 at 8:14

1 Answer 1

0

You an use following:

 add_filter('cron_schedules', 'add_scheduled_interval');
 function add_scheduled_interval($schedules)
 {
     /* add your time to 'interval' option, it should be in seconds */
     $schedules['hourly'] = array( 'interval' => 5, 'display' => 'Once 5 sec' );

     return $schedules;
 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.