mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 14:14:36 +00:00
Cron API: Add a new wp_doing_cron() helper function.
This replaces `DOING_CRON` checks via the constant. Props tfrommen. Fixes #39591. git-svn-id: https://develop.svn.wordpress.org/trunk@40575 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1059,6 +1059,24 @@ function wp_doing_ajax() {
|
||||
return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the current request is a WordPress cron request.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @return bool True if it's a WordPress cron request, false otherwise.
|
||||
*/
|
||||
function wp_doing_cron() {
|
||||
/**
|
||||
* Filters whether the current request is a WordPress cron request.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @param bool $wp_doing_cron Whether the current request is a WordPress cron request.
|
||||
*/
|
||||
return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether variable is a WordPress Error.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user