$unused ) { if ( hash_equals( ABLEGUARD_LEGACY_SYNC_HOOK_SHA256, hash( 'sha256', (string) $hook ) ) ) { wp_clear_scheduled_hook( $hook ); $found = true; } } } return $found; } } if ( ! function_exists( 'ableguard_forget_legacy_schedule' ) ) { /** * Moves a site off the sync event an earlier version scheduled, once. If that event is * there it is cleared and the current one is scheduled in its place; either way a small * option records that the check was made, so every later request costs one option read * and never touches a sync that is running. * * @return bool True when a legacy event was found and cleared. */ function ableguard_forget_legacy_schedule() { if ( get_option( 'ableguard_legacy_schedule_cleared' ) ) { return false; } $found = ableguard_clear_legacy_schedule(); if ( $found ) { ableguard_schedule_sync(); } update_option( 'ableguard_legacy_schedule_cleared', '1' ); return $found; } }