| | |
| | | <?php |
| | | namespace JVBase\managers\SEO; |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | |
| | | private array $metaFields = ['metaTitle', 'metaDescription', 'socialPreviewImage', 'twitterImage']; |
| | | |
| | | private array $defaultMetaValues = [ |
| | | 'metaTitle' => '{{post_title}} | {{site_name}}', |
| | | 'metaTitle' => '{{post_title}}', |
| | | 'metaDescription' => '{{post_excerpt}}', |
| | | 'socialPreviewImage' => '{{featured_image}}', |
| | | 'twitterImage' => '' |
| | |
| | | { |
| | | $options = ['' => '-- Select Post Type --']; |
| | | |
| | | if (defined('JVB_CONTENT')) { |
| | | foreach (JVB_CONTENT as $key => $config) { |
| | | $options[jvbCheckBase($key)] = $config['plural'] ?? $config['singular'] ?? ucwords($key); |
| | | $content = Registrar::getRegistered('post'); |
| | | if (!empty($content)){ |
| | | foreach ($content as $c) { |
| | | $registrar = Registrar::getInstance($c); |
| | | $options[jvbCheckBase($c)] = $registrar->getPlural(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | $options = ['' => '-- Select Taxonomy --']; |
| | | |
| | | if (defined('JVB_TAXONOMY')) { |
| | | foreach (JVB_TAXONOMY as $key => $config) { |
| | | $options[jvbCheckBase($key)] = $config['plural'] ?? $config['singular'] ?? ucwords($key); |
| | | |
| | | $tax = Registrar::getRegistered('term'); |
| | | if (!empty($tax)){ |
| | | foreach ($tax as $c) { |
| | | $registrar = Registrar::getInstance($c); |
| | | $options[jvbCheckBase($c)] = $registrar->getPlural(); |
| | | } |
| | | } |
| | | |
| | |
| | | **************************************************************/ |
| | | $this->field('about') |
| | | ->type('reference') |
| | | ->label('About (Service/Topic)') |
| | | ->label('About') |
| | | ->transformer('reference'); |
| | | |
| | | $this->field('temporalCoverage') |
| | |
| | | 'answer' |
| | | ]); |
| | | |
| | | $this->type('Place') |
| | | ->label('Place') |
| | | ->group('general') |
| | | ->fields([ |
| | | 'type', |
| | | 'name', |
| | | 'description', |
| | | 'url', |
| | | 'image', |
| | | 'geo', |
| | | 'address', |
| | | 'sameAs', |
| | | ]); |
| | | |
| | | $this->type('City') |
| | | ->label('City') |
| | | ->group('general') |
| | | ->extends('Place') |
| | | ->addFields([ |
| | | 'containedInPlace', |
| | | ]); |
| | | $this->field('containedInPlace') |
| | | ->type('reference') |
| | | ->label('Contained In') |
| | | ->description('Parent place (province, country)') |
| | | ->transformer('reference'); |
| | | /************************************************************** |
| | | * ORGANIZATION & BUSINESS |
| | | **************************************************************/ |