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:
2026-09-27 04:20:44 +02:00
co-authored by Claude Opus 5.5
parent 1c2acdfbbe
commit ae994ad7bd
2 changed files with 24 additions and 1 deletions
@@ -205,7 +205,14 @@ final class DiviDynamicSourcesAbility implements Ability
return '{{post:' . $post . '}}';
}
return str_starts_with($name, 'post_link_url_') ? '{{link:<ID>}}' : null;
if (! str_starts_with($name, 'post_link_url_')) {
return null;
}
// Review M-9: {{link:}} refuses attachments (status inherit); internal types ("_…") are no link targets.
$type = substr($name, strlen('post_link_url_'));
return $type === 'attachment' || str_starts_with($type, '_') ? null : '{{link:<ID>}}';
}
/**