| | |
| | | private array $metaFields = ['metaTitle', 'metaDescription', 'socialPreviewImage', 'twitterImage']; |
| | | |
| | | private array $defaultMetaValues = [ |
| | | 'title' => '{{post_title}} | {{site_name}}', |
| | | 'description' => '{{post_excerpt}}', |
| | | 'image' => '{{featured_image}}', |
| | | 'twitter_image' => '' |
| | | 'metaTitle' => '{{post_title}} | {{site_name}}', |
| | | 'metaDescription' => '{{post_excerpt}}', |
| | | 'socialPreviewImage' => '{{featured_image}}', |
| | | 'twitterImage' => '' |
| | | ]; |
| | | |
| | | public static function getInstance(): self |
| | |
| | | */ |
| | | public function getFieldDefinition(string $fieldName): ?array |
| | | { |
| | | $definitions = $this->getFieldDefinitions(); |
| | | $definitions = apply_filters(BASE . 'schema_field_definitions', $this->fieldDefinitions); |
| | | return $definitions[$fieldName] ?? null; |
| | | } |
| | | |
| | | /** |
| | | * Get all field definitions |
| | | */ |
| | | public function getFieldDefinitions(): array |
| | | { |
| | | return apply_filters(BASE . 'schema_field_definitions', $this->fieldDefinitions); |
| | | } |
| | | |
| | | /** |
| | | * Get type definition |