WPDev.one
Core Function
View Source on Trac ↗

wp_unschedule_hook()

wp_unschedule_hook( mixed $hook, mixed $wp_error = false )

Unschedules all events attached to the hook.

Parameters 1 required

Name / Type Description
$hook
string

Action hook, the execution of which will be unscheduled.

Required
$wp_error
bool

Optional. Whether to return a WP_Error on failure. Default false.

Return Value

((int)
(int | false | WP_Error) On success an integer indicating number of events unscheduled (0 indicates no events were registered on the hook), false or WP_Error if unscheduling fails.

Function Information

Since Version
4.9.0
Source File
wp-includes/cron.php
Advertisement