equal
deleted
inserted
replaced
1 <?php |
1 <?php |
2 /** |
2 /** |
3 * A pseudo-CRON daemon for scheduling WordPress tasks |
3 * A pseudo-cron daemon for scheduling WordPress tasks. |
4 * |
4 * |
5 * WP Cron is triggered when the site receives a visit. In the scenario |
5 * WP-Cron is triggered when the site receives a visit. In the scenario |
6 * where a site may not receive enough visits to execute scheduled tasks |
6 * where a site may not receive enough visits to execute scheduled tasks |
7 * in a timely manner, this file can be called directly or via a server |
7 * in a timely manner, this file can be called directly or via a server |
8 * CRON daemon for X number of times. |
8 * cron daemon for X number of times. |
9 * |
9 * |
10 * Defining DISABLE_WP_CRON as true and calling this file directly are |
10 * Defining DISABLE_WP_CRON as true and calling this file directly are |
11 * mutually exclusive and the latter does not rely on the former to work. |
11 * mutually exclusive and the latter does not rely on the former to work. |
12 * |
12 * |
13 * The HTTP request to this file will not slow down the visitor who happens to |
13 * The HTTP request to this file will not slow down the visitor who happens to |
14 * visit when the cron job is needed to run. |
14 * visit when a scheduled cron event runs. |
15 * |
15 * |
16 * @package WordPress |
16 * @package WordPress |
17 */ |
17 */ |
18 |
18 |
19 ignore_user_abort( true ); |
19 ignore_user_abort( true ); |
31 if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) { |
31 if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) { |
32 die(); |
32 die(); |
33 } |
33 } |
34 |
34 |
35 /** |
35 /** |
36 * Tell WordPress we are doing the CRON task. |
36 * Tell WordPress we are doing the cron task. |
37 * |
37 * |
38 * @var bool |
38 * @var bool |
39 */ |
39 */ |
40 define( 'DOING_CRON', true ); |
40 define( 'DOING_CRON', true ); |
41 |
41 |