Adds ability to exclude components from specific: - Categories (by slug or term_id) - Post/Page IDs - URL patterns (substring or regex) Architecture: - Domain: Value Objects (CategoryExclusion, PostIdExclusion, UrlPatternExclusion, ExclusionRuleSet) + Contracts - Application: EvaluateExclusionsUseCase + EvaluateComponentVisibilityUseCase (orchestrator) - Infrastructure: WordPressExclusionRepository, WordPressPageContextProvider, WordPressServerRequestProvider - Admin: ExclusionFormPartial (reusable UI), ExclusionFieldProcessor, JS toggle The PageVisibilityHelper now uses the orchestrator UseCase that combines page-type visibility (Plan 99.10) with exclusion rules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
905 B
PHP
34 lines
905 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Shared\Domain\Contracts;
|
|
|
|
/**
|
|
* Contrato para obtener el contexto de la pagina actual
|
|
*
|
|
* Abstrae la obtencion de datos del contexto actual (WordPress).
|
|
* Permite testear UseCases sin dependencia de WordPress.
|
|
*
|
|
* v1.1: Renombrado de ExclusionEvaluatorInterface (nombre semantico incorrecto)
|
|
* El nombre refleja que PROVEE contexto, no que EVALUA.
|
|
*
|
|
* Metodos: 1 (cumple ISP < 5 metodos)
|
|
*
|
|
* @package ROITheme\Shared\Domain\Contracts
|
|
*/
|
|
interface PageContextProviderInterface
|
|
{
|
|
/**
|
|
* Obtiene el contexto actual para evaluacion de exclusiones
|
|
*
|
|
* @return array{
|
|
* post_id: int,
|
|
* categories: array<array{term_id: int, slug: string, name: string}>,
|
|
* url: string,
|
|
* request_uri: string,
|
|
* post_type: string
|
|
* }
|
|
*/
|
|
public function getCurrentContext(): array;
|
|
}
|