refactor: PostRow::update and PostGuard::assertNoMissedSchedule (M5)
- PostRow::update(id, columns, failure) / ::save(): the slashed wp_update_post of internal row writes, refusals as RuntimeException '<failure>: <why>'. Used by ContentUpdate::restoreRow, PostCloner::updateRow, MediaMetaWriter apply/restore. - PostGuard::assertNoMissedSchedule(postId, message) replaces the re-read + check in ContentUpdate::restoreRow, PostCloner and DiviSaver::restore (DiviSaver keeps its own kses window; M4). - PostCloner::restore uses Rollback::attempt. Log messages unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -172,10 +172,7 @@ class DiviSaver
|
||||
{
|
||||
$detail = sprintf('Saving Divi content of post %d failed: %s', $postId, $cause->getMessage());
|
||||
$failures = Rollback::attempt(function () use ($postId, $before): void {
|
||||
$current = get_post($postId);
|
||||
if ($current instanceof WP_Post && PostGuard::missedSchedule($current)) {
|
||||
throw new RuntimeException('restoring would publish a missed schedule');
|
||||
}
|
||||
PostGuard::assertNoMissedSchedule($postId, 'restoring would publish a missed schedule');
|
||||
|
||||
$restored = $this->withoutKses(
|
||||
static fn (): int|WP_Error
|
||||
|
||||
Reference in New Issue
Block a user