feat: {{link:ID}} placeholder via Divi's post_link_url dynamic content

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 00:32:59 +02:00
co-authored by Claude Opus 5.5
parent 404f0f34b9
commit 788943e809
11 changed files with 304 additions and 21 deletions
+17 -1
View File
@@ -6,6 +6,7 @@ namespace LIT\MCP\Tests\Support;
use LIT\MCP\Integrations\Divi\Compose\AttrWriter;
use LIT\MCP\Integrations\Divi\Compose\Composer;
use LIT\MCP\Integrations\Divi\Compose\LinkTargets;
use LIT\MCP\Integrations\Divi\Compose\MediaResolver;
use LIT\MCP\Integrations\Divi\Compose\Placeholders;
use LIT\MCP\Integrations\Divi\Compose\ShortformWriter;
@@ -128,9 +129,24 @@ final class ComposeFixture
};
}
/** Link targets of the tests: 839 is a page, 840 a post; everything else is missing, trashed or unreadable. */
public static function links(): LinkTargets
{
return new class implements LinkTargets {
public function postTypeOf(int $id): ?string
{
return match ($id) {
839 => 'page',
840 => 'post',
default => null,
};
}
};
}
public static function placeholders(): Placeholders
{
return new Placeholders(DiviFixtures::designSystem());
return new Placeholders(DiviFixtures::designSystem(), self::links());
}
/** The strict $variable(…)$ checker for the sample design system and the default map. */