| | |
| | | <?php |
| | | namespace JVBase\managers\SEO; |
| | | |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\meta\MetaManager; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Meta; |
| | | use WP_Term; |
| | | use WP_User; |
| | | |
| | |
| | | * Integrates with The SEO Framework, letting it handle defaults |
| | | * while we override with our configured templates. |
| | | * |
| | | * Now with integrated caching via CacheManager for performance. |
| | | * Now with integrated caching via Cache for performance. |
| | | */ |
| | | class SchemaOutputManager |
| | | { |
| | | private ConfigManager $config; |
| | | private SchemaBuilder $registry; |
| | | private ?TemplateResolver $resolver = null; |
| | | private CacheManager $cache; |
| | | private Cache $cache; |
| | | private array $pseudoTypes = [ |
| | | 'BeforeAfter', |
| | | ]; |
| | |
| | | public function __construct() |
| | | { |
| | | $this->registry = SchemaBuilder::getInstance(); |
| | | $this->cache = CacheManager::for('schema'); |
| | | |
| | | // Register cache connections |
| | | $this->cache->connectTo('post', 'id'); |
| | | $this->cache->connectTo('taxonomy', 'id'); |
| | | $this->cache->connectTo('user', 'id'); |
| | | $this->cache = Cache::for('schema') |
| | | ->connect('post',true) |
| | | ->connect('taxonomy',true) |
| | | ->connect('user',true); |
| | | |
| | | // Hook into TSF for meta |
| | | add_filter('the_seo_framework_title_from_generation', [$this, 'filterTitle'], 10, 2); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Enhanced buildSchemaFromConfig with MetaManager integration |
| | | * Enhanced buildSchemaFromConfig with Meta integration |
| | | */ |
| | | private function buildSchemaFromConfig(array $config, string $schemaType, ?string $id = null): ?array |
| | | { |
| | |
| | | $schema['@id'] = $id; |
| | | } |
| | | |
| | | // Get MetaManager if we have a context |
| | | // Get Meta if we have a context |
| | | $meta = null; |
| | | $context = $this->getCurrentContext(); |
| | | if ($context) { |
| | | $meta = new MetaManager($context['objectId'], $context['objectType']); |
| | | $meta = new Meta($context['objectId'], $context['objectType']); |
| | | } |
| | | |
| | | // Process each field |