Files
WP-LIT-MCP/src/Integrations/Divi/ThemeBuilder/ThemeBuilderIntegration.php
T
janniclas.loosenandClaude Opus 5.5 6be2e65432 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>
2026-09-27 21:02:53 +02:00

69 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace LIT\MCP\Integrations\Divi\ThemeBuilder;
use LIT\MCP\ChangeLog\ChangeLog;
use LIT\MCP\Integrations\Divi\Pages\DiviComposition;
use LIT\MCP\Integrations\Divi\Pages\DiviSaver;
use LIT\MCP\Integrations\Divi\Pages\DynamicFields;
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
use LIT\MCP\Integrations\Integration;
defined('ABSPATH') || exit;
/**
* The group "Divi Theme Builder" (Etappe 3b): lit/tb-list, lit/tb-create-template, lit/tb-assign and
* lit/tb-activate, all indirect. Built by DiviIntegration::themeBuilder() so it shares the Theme Builder access
* (rights, Tools-tab gates – its id ThemeBuilderAccess::GROUP is what the gates of the Divi tools ask; once this
* group is registered, its mode and "nur lesen" switch in the Tools tab drive them). Available with the Divi 5
* builder, like the Divi group; missing Divi internals show in lit-site-status. Composition, saver and log serve
* the writing tools.
*/
final class ThemeBuilderIntegration implements Integration
{
public function __construct(
private ThemeBuilderAccess $access,
private DiviComposition $composition,
private DiviSaver $saver,
private ChangeLog $log,
private DynamicFields $fields
) {
}
public function id(): string
{
return ThemeBuilderAccess::GROUP;
}
public function label(): string
{
return __('Divi Theme Builder', 'wp-lit-mcp');
}
public function isAvailable(): bool
{
return DiviModules::isAvailable();
}
public function abilities(): array
{
$conditions = new TemplateConditions($this->access->store());
return [
new TbListAbility($this->access, $conditions),
new TbCreateTemplateAbility(
$this->access,
$conditions,
$this->composition,
$this->saver,
$this->log,
new ThemeBuilderEdits($this->access, fields: $this->fields)
),
new TbAssignAbility($this->access, $conditions, $this->log),
new TbActivateAbility($this->access, $conditions, $this->log),
];
}
}