Changeset 50135
- Timestamp:
- 02/02/2021 03:08:53 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cron.php
r49963 r50135 745 745 746 746 /** 747 * Run scheduled callbacks or spawn cron for all scheduled events. 747 * Register _wp_cron() to run on the {@see 'wp_loaded'} action. 748 * 749 * If the {@see 'wp_loaded'} action has already fired, this function calls 750 * _wp_cron() directly. 748 751 * 749 752 * Warning: This function may return Boolean FALSE, but may also return a non-Boolean … … 754 757 * @since 2.1.0 755 758 * @since 5.1.0 Return value added to indicate success or failure. 759 * @since 5.7.0 Functionality moved to _wp_cron() to which this becomes a wrapper. 760 * 761 * @return bool|int|void On success an integer indicating number of events spawned (0 indicates no 762 * events needed to be spawned), false if spawning fails for one or more events or 763 * void if the function registered _wp_cron() to run on the action. 764 */ 765 function wp_cron() { 766 if ( did_action( 'wp_loaded' ) ) { 767 return _wp_cron(); 768 } 769 770 add_action( 'wp_loaded', '_wp_cron', 20 ); 771 } 772 773 /** 774 * Run scheduled callbacks or spawn cron for all scheduled events. 775 * 776 * Warning: This function may return Boolean FALSE, but may also return a non-Boolean 777 * value which evaluates to FALSE. For information about casting to booleans see the 778 * {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use 779 * the `===` operator for testing the return value of this function. 780 * 781 * @since 5.7.0 782 * @access private 756 783 * 757 784 * @return int|false On success an integer indicating number of events spawned (0 indicates no 758 785 * events needed to be spawned), false if spawning fails for one or more events. 759 786 */ 760 function wp_cron() {787 function _wp_cron() { 761 788 // Prevent infinite loops caused by lack of wp-cron.php. 762 789 if ( strpos( $_SERVER['REQUEST_URI'], '/wp-cron.php' ) !== false || ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ) {
Note: See TracChangeset
for help on using the changeset viewer.