Codex

Function Reference/wp unschedule event

Contents

Description

Un-schedules a previously-scheduled cron job.

Usage

 <?php wp_unschedule_event$timestamp$hook$args ); ?> 

Note that you need to know the exact time of the next occurrence when scheduled hook was set to run, and the function arguments it was supposed to have, in order to unschedule it. All future occurrences are un-scheduled by calling this function.

Parameters

$timestamp
(integer) (required) Timestamp originally provided for when to run the event.
Default: None
$hook
(string) (required) Action hook originally provided, the execution of which will be unscheduled.
Default: None
$args
(string) (optional) Arguments to pass to the hook's callback function. Although not passed to a callback function, these arguments are used to uniquely identify the scheduled event, so they should be the same as those used when originally scheduling the event.
Default: array()

Return Value

This function does not return a value

Example

<?php
	$timestamp = wp_next_scheduled( 'my_schedule_hook' );
	wp_unschedule_event($timestamp, 'my_schedule_hook', original_args );
?>

Notes

Change Log

Since: 2.1.0

Source File

wp_unschedule_event() is located in wp-includes/cron.php

Related

See also index of Function Reference and index of Template Tags.
This page is marked as incomplete. You can help Codex by expanding it.