refactor: Kern ohne Divi – Ports BuilderDetector, MediaUsageSource, EnvironmentComponent und ausgeschlossene Post-Typen im ContentSchema; Divi-Implementierungen und Verdrahtung über DiviIntegration/Plugin; CoreIndependenceTest
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
abeb4b0eed
commit
06148fb8c1
@@ -26,8 +26,12 @@ defined('ABSPATH') || exit;
|
||||
*/
|
||||
final class RevisionsListAbility implements Ability
|
||||
{
|
||||
public function __construct(private ContentSchema $schema)
|
||||
private PostPresenter $presenter;
|
||||
|
||||
/** @param PostPresenter|null $presenter Knows the page builder (BuilderDetector); null = no builder. */
|
||||
public function __construct(private ContentSchema $schema, ?PostPresenter $presenter = null)
|
||||
{
|
||||
$this->presenter = $presenter ?? new PostPresenter($schema);
|
||||
}
|
||||
|
||||
public function name(): string
|
||||
@@ -127,7 +131,7 @@ final class RevisionsListAbility implements Ability
|
||||
'post_id' => (int) $post->ID,
|
||||
'items' => $items,
|
||||
'next_cursor' => $page['next_cursor'],
|
||||
'hints' => in_array(true, array_column($items, 'divi'), true) ? [PostPresenter::diviHint()] : [],
|
||||
'hints' => in_array(true, array_column($items, 'divi'), true) ? [$this->presenter->diviHint()] : [],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -146,7 +150,7 @@ final class RevisionsListAbility implements Ability
|
||||
'title' => (string) $revision->post_title,
|
||||
'autosave' => (bool) wp_is_post_autosave($revision),
|
||||
'excerpt' => mb_substr($text, 0, 160),
|
||||
'divi' => PostPresenter::usesDivi($revision),
|
||||
'divi' => $this->presenter->usesDivi($revision),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user