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>
69 lines
2.2 KiB
PHP
69 lines
2.2 KiB
PHP
<?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),
|
||
];
|
||
}
|
||
}
|