Make WordPress Core

Opened 2 months ago

Last modified 5 days ago

#60645 assigned enhancement

Add pre-fire hook for cron

Reported by: kkmuffme's profile kkmuffme Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Cron API Keywords: has-patch needs-testing needs-docs
Focuses: Cc:

Description

Followup to https://core.trac.wordpress.org/ticket/56048 https://core.trac.wordpress.org/changeset/54258

This adds an additional hook before every cron event to allow for custom code to run before a cron hook

Use cases:

  • custom error checking (e.g. if a cron even has no callbacks,...)
  • load libraries/functions/classes that are only needed for a specific number of cron events and would otherwise slow down the site/cron - this hook allows you to handle multiple at once which is useful for e.g. dynamic hook names or for cases where you need to run it for a number of hooks (instead of adding 100 add_action with same callback)

Change History (6)

This ticket was mentioned in PR #6189 on WordPress/wordpress-develop by @kkmuffme.


2 months ago
#1

  • Keywords has-patch added

This ticket was mentioned in Slack in #core by kkmuffme. View the logs.


3 weeks ago

#3 @jorbin
3 weeks ago

  • Version 6.5 deleted

#4 @audrasjb
3 weeks ago

  • Keywords needs-testing added
  • Owner set to audrasjb
  • Status changed from new to assigned

Self assigning for review and tests.

#5 @audrasjb
10 days ago

  • Milestone changed from Awaiting Review to 6.6

#6 @rajinsharwar
5 days ago

  • Keywords needs-docs added

Added a small space change suggestion, also we will be needing docs for this hook I believe.

Note: See TracTickets for help on using tickets.