Skip to content

Commit

Permalink
fix as older versions compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
selul committed Apr 18, 2024
1 parent 305a959 commit b0bbf89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inc/media_offload.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function maybe_reschedule() {
return;
}
self::$instance->logger->add_log( $transfer_type, 'Cron missed, attempt to reschedule.' );
self::get_image_count( $transfer_type, true );
self::get_image_count( $transfer_type, false );
}

/**
Expand Down Expand Up @@ -2063,6 +2063,9 @@ public static function schedule_action( $time, $hook, $args ) {
public static function is_scheduled( $hook ) {
if ( function_exists( 'as_has_scheduled_action' ) ) {
return as_has_scheduled_action( $hook );
} elseif ( function_exists( 'as_next_scheduled_action' ) ) {
// For older versions of AS.
return as_next_scheduled_action( $hook ) !== false;
} else {
return wp_next_scheduled( $hook ) !== false;
}
Expand Down

0 comments on commit b0bbf89

Please sign in to comment.