Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/wp-includes/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ function wp_unschedule_event( $timestamp, $hook, $args = array(), $wp_error = fa
return $pre;
}

$crons = _get_cron_array();
$crons = _get_cron_array( true );
$key = md5( serialize( $args ) );

unset( $crons[ $timestamp ][ $hook ][ $key ] );
Expand Down Expand Up @@ -1223,9 +1223,14 @@ function wp_get_ready_cron_jobs() {
* @since 6.1.0 Return type modified to consistently return an array.
* @access private
*
* @param bool $fresh whether a non-cached version is required
* @return array[] Array of cron events.
*/
function _get_cron_array() {
function _get_cron_array( $fresh = false ) {
if ( $fresh ) {
wp_cache_delete( 'alloptions', 'options' ); // there doesn't seem to be a more surgical way
}

$cron = get_option( 'cron' );
if ( ! is_array( $cron ) ) {
return array();
Expand Down