Filter hook 'wp_doing_cron'

in WP Core File wp-includes/load.php at line 1785

View Source

wp_doing_cron

Filter Hook
Description
Filters whether the current request is a WordPress cron request.

Hook Information

File Location wp-includes/load.php View on GitHub
Hook Type Filter
Line Number 1785

Hook Parameters

Type Name Description
bool $wp_doing_cron Whether the current request is a WordPress cron request.

Usage Examples

Basic Usage
<?php
// Hook into wp_doing_cron
add_filter('wp_doing_cron', 'my_custom_filter', 10, 1);

function my_custom_filter($wp_doing_cron) {
    // Your custom filtering logic here
    return $wp_doing_cron;
}

Source Code Context

wp-includes/load.php:1785 - How this hook is used in WordPress core
<?php
1780  	 *
1781  	 * @since 4.8.0
1782  	 *
1783  	 * @param bool $wp_doing_cron Whether the current request is a WordPress cron request.
1784  	 */
1785  	return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON );
1786  }
1787  
1788  /**
1789   * Checks whether the given variable is a WordPress Error.
1790   *

PHP Documentation

<?php
/**
	 * 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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/load.php
Related Hooks

Related hooks will be displayed here in future updates.