| | |
| | | use JVBase\managers\SEO\SchemaFieldHelpers; |
| | | use JVBase\managers\SEO\SchemaReferenceBuilder; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | |
| | | return $fields; |
| | | } |
| | | |
| | | $contentConfig = $this->getContentConfig($definition->contentType); |
| | | |
| | | if (empty($contentConfig)) { |
| | | $registrar = Registrar::getInstance($definition->contentType); |
| | | if (!$registrar){ |
| | | return $fields; |
| | | } |
| | | |
| | | |
| | | // Derive artform from style taxonomy terms |
| | | $artform = $this->deriveFromTaxonomy($definition->objectId, $contentConfig, 'style'); |
| | | if (!empty($artform)) { |
| | |
| | | } |
| | | |
| | | return SchemaReferenceBuilder::build( |
| | | $post->post_author, |
| | | 'user', |
| | | $post->post_author, |
| | | 'Person' |
| | | ); |
| | | } |
| | |
| | | return array_unique($keywords); |
| | | } |
| | | |
| | | /** |
| | | * Get content config from JVB_CONTENT constant. |
| | | */ |
| | | private function getContentConfig(?string $contentType): array |
| | | { |
| | | if (!$contentType || !defined('JVB_CONTENT')) { |
| | | return []; |
| | | } |
| | | |
| | | $slug = jvbNoBase($contentType); |
| | | |
| | | return JVB_CONTENT[$slug] ?? []; |
| | | } |
| | | } |