schedule_event WordPress Filter Hook

The schedule_event hook allows you to schedule an event to occur at a specific time. You can use this hook to schedule a post to be published at a later time, or to schedule an event to occur at a specific time.

apply_filters( 'schedule_event', stdClass|false $event ) #

Modify an event before it is scheduled.


Parameters

$event

(stdClass|false)An object containing an event's data, or boolean false to prevent the event from being scheduled.

  • 'hook'
    (string) Action hook to execute when the event is run.
  • 'timestamp'
    (int) Unix timestamp (UTC) for when to next run the event.
  • 'schedule'
    (string|false) How often the event should subsequently recur.
  • 'args'
    (array) Array containing each separate argument to pass to the hook's callback function.
  • 'interval'
    (int) The interval time in seconds for the schedule. Only present for recurring events.


Top ↑

More Information

  • The hook is applied when a new event is added to the cron schedule. The hook passes through one parameter: the $event being scheduled.
  • In WordPress 3.21, the following recurring events are scheduled by the core: wp_version_check, wp_update_plugins, wp_update_themes, wp_schedule_delete, and (for the main site of multisite installs only) wp_update_network_counts.
  • In WordPress 3.21, the following single events are scheduled on demand by the core: publish_future_post, do_pings, importer_scheduled_cleanup.

Top ↑

Source

File: wp-includes/cron.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.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.