pre_clear_scheduled_hook WordPress Filter Hook

The pre_clear_scheduled_hook hook is called before a scheduled event is cleared from the database. This hook can be used to perform any necessary actions before an event is deleted, such as cleaning up any associated data.

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

Filter to preflight or hijack clearing a scheduled 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 event.

$hook

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

$args

(array)Arguments to pass to the hook's callback function.

$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.