feat: Divi read tools accept library entries (library access, E1/E3)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 01:02:25 +02:00
co-authored by Claude Opus 5.5
parent 2700fd615a
commit 48ecc627aa
13 changed files with 487 additions and 13 deletions
+7 -1
View File
@@ -45,7 +45,7 @@ final class PostGuard
$post = get_post($id);
if (! $post instanceof WP_Post || ! $schema->isManaged((string) $post->post_type)) {
return Errors::notFound(sprintf('Eintrag %d nicht gefunden (oder kein unterstützter Inhaltstyp).', $id));
return self::notFound($id);
}
if (! current_user_can('edit_post', $id)) {
@@ -63,6 +63,12 @@ final class PostGuard
return $post;
}
/** The refusal for an ID that names no entry the tools manage – the same for every such ID. */
public static function notFound(int $id): WP_Error
{
return Errors::notFound(sprintf('Eintrag %d nicht gefunden (oder kein unterstützter Inhaltstyp).', $id));
}
/**
* A scheduled entry whose publication time has passed (WordPress' cron missed it) or is
* less than a minute away: wp_insert_post() turns "future" into "publish" on any save when