• function more_reccurences() {
    	return array(
    		'fively' => array('interval' => 300, 'display' => 'Five'),
    		'tenly' => array('interval' => 600, 'display' => 'Ten'),
    		'weekly' => array('interval' => 604800, 'display' => 'Week')
    	);
    }

    I use this to provide three more reccurences. wp_schedule_event(time(), 'fively', 'my_wp_event');, and it will excute every five minutes. There is also an admin page to set the option for this plugin, so i change the reccurence for ‘tenly’, it should be excuted for every ten minutes now. but i find it is still using ‘fively’ with cron-view.

    So what i can do, if I need to change the interval frequently.
    for example, i want to excute an action at the last second of every month, then the interval will change.

    Anybody know how to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • may be scheduling single events and replacing start time with a defined variable.

    In wp_schedule_event, replace time() with a defined variable:
    $time = strtotime("september 30, 23 hours 59 minutes 59 seconds");
    now $time is a fixed value to schedule your event.

    define an array() with the twelve values and that’s all ??

    sorry, the correct function for single events is:
    wp_schedule_single_event( $time, 'your_event' );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘May I change the $recurrence for one schedule that has been added’ is closed to new replies.