feat: Pods fields in Theme Builder bodies checked against the template's post types (E12)

Both forms Divi writes are recognized (ruling Q11): custom_meta_<key> and the
dialog form post_meta_key + select_meta_key. Choice fields get a note about the
stored value, relation fields name IDs (F4). Only templates the user may edit
are checked or named; others are counted (Q21 pattern). Warnings only, also in
the dry run of a live body. DynamicFields extracted from lit/divi-dynamic-sources.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 21:02:53 +02:00
co-authored by Claude Opus 5.5
parent a31d4340f9
commit 6be2e65432
15 changed files with 778 additions and 86 deletions
+9 -1
View File
@@ -211,9 +211,17 @@ final class DiviWriter
return $this->save($ability, $page, $change, $input, SaveScope::ThemeBuilderLayout);
}
// E12: fields in a body checked against the templates' post types – warnings only, also in the dry run.
$fieldWarnings = $this->themeBuilder->fieldWarnings($page, $change);
foreach ($fieldWarnings as $warning) {
$change->warning($warning);
}
$prepared = $this->themeBuilder->prepare($page, $input);
if ($prepared instanceof WP_Error) {
return $prepared;
return $fieldWarnings !== [] && Errors::codeOf($prepared) === 'confirm_required'
? VisibleEdits::merged($prepared, 'Hinweise zu Feldern siehe warnings.', ['warnings' => $fieldWarnings])
: $prepared;
}
return $this->savePrepared($ability, $page, $change, $input, $prepared, 'des Theme-Builder-Layouts');