fix: lit/divi-dynamic-sources offers no {{link:<ID>}} for attachments (M-9)
Also none for internal post types (post_link_url__et_pb_speculation). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,22 @@ final class DiviDynamicSourcesAbilityTest extends TestCase
|
||||
self::assertSame('lit/divi-dynamic-sources', $this->ability()->name());
|
||||
}
|
||||
|
||||
/** Review M-9: {{link:}} refuses attachments (status inherit), so their link sources get no hint. */
|
||||
public function testNoLinkHintForAttachmentsOrInternalTypes(): void
|
||||
{
|
||||
$registry = DiviFixtures::dynamicContentRegistry();
|
||||
foreach (['post_link_url_attachment', 'post_link_url__et_pb_speculation'] as $name) {
|
||||
$registry[$name] = $registry['post_link_url_page'];
|
||||
$registry[$name]['id'] = $name;
|
||||
}
|
||||
|
||||
$sources = array_column($this->ability([], 'meta', $registry)->execute(['post_type' => 'page'])['sources'], null, 'name');
|
||||
|
||||
self::assertSame('{{link:<ID>}}', $sources['post_link_url_page']['placeholder']);
|
||||
self::assertNull($sources['post_link_url_attachment']['placeholder']);
|
||||
self::assertNull($sources['post_link_url__et_pb_speculation']['placeholder']);
|
||||
}
|
||||
|
||||
public function testOffersTextLikeFieldsAndNamesTheOthers(): void
|
||||
{
|
||||
$result = $this->ability()->execute(['post_type' => 'page']);
|
||||
|
||||
Reference in New Issue
Block a user