WordPress at a glance
Home All Function Functions APIs Cron API

wp_doing_cron() WP 1.0

Determines whether the current request is a WordPress cron request.

✈ 1 time = 0.000021s = very fast | 50000 times = 0.12s = very fast | PHP 7.1.2, WP 4.8
Hooks from the function
Return

true/false. True if it's a WordPress cron request, false otherwise.

Usage

wp_doing_cron();

Changelog

Since 4.8.0 Introduced.

Code of wp doing cron: wp-includes/load.php WP 5.2.3

<?php
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 );
}

Related Functions

From tag: Conditional tags (page type and request)

More from tag: Conditional tags (all)

More from category: Cron API

No comments
    Hello, !     Log In . Register