pre_unschedule_hook WordPress Filter Hook

The pre_unschedule_hook is a Wordpress hook that is triggered before a scheduled event is unscheduled. This hook can be used to perform cleanup or other actions before an event is unscheduled.

apply_filters( 'pre_unschedule_hook', null|int|false|WP_Error $pre, string $hook, bool $wp_error ) #

Filter to preflight or hijack clearing all events attached to the hook.


Description

Returning a non-null value will short-circuit the normal unscheduling process, causing the function to return the filtered value instead.

For plugins replacing wp-cron, return the number of events successfully unscheduled (zero if no events were registered with the hook) or false if unscheduling one or more events fails.


Top ↑

Parameters

$pre

(null|int|false|WP_Error)Value to return instead. Default null to continue unscheduling the hook.

$hook

(string)Action hook, the execution of which will be unscheduled.

$wp_error

(bool)Whether to return a WP_Error on failure.


Top ↑

Source

File: wp-includes/cron.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.7.0The $wp_error parameter was added, and a WP_Error object can now be returned.
5.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.