| | |
| | | $config = $this->getConfig(); |
| | | |
| | | $class = JVB()->schemaHelper()::classFromConfig($config, $meta); |
| | | |
| | | $class->setAuthor(JVB()->seo()->getCreator(true)); |
| | | |
| | | $class = apply_filters('jvb_single_'.$this->slug.'_schema_output', $class, $ID); |
| | | return $class->outputSchema(); |
| | | } |
| | | ); |
| | |
| | | $class->setMainEntity($itemList); |
| | | |
| | | $schema = $class->outputSchema(); |
| | | error_log('Generated archive schema: '.print_r($schema, true)); |
| | | if (JVB_TESTING) { |
| | | // error_log('Generated archive schema: '.print_r($schema, true)); |
| | | } |
| | | |
| | | return $schema; |
| | | } |
| | | ); |
| | |
| | | $config['type'] = $this->defaultSchema['type']; |
| | | update_option(BASE.ucfirst($this->slug).'Schema', $config); |
| | | } |
| | | $class = $this->getConfig()['type']; |
| | | $class = $config['type']; |
| | | if (!class_exists($class)) { |
| | | error_log('[SEO]Schema::defineReference Class not found: '.$class); |
| | | return; |
| | |
| | | if (is_singular($based)){ |
| | | $config = $this->getConfig('meta'); |
| | | $meta = Meta::forPost(get_the_ID()); |
| | | $title = Resolver::resolve($config['name']??$config['title'], $meta); |
| | | $title = Resolver::resolve($config['name']??$config['title']??'', $meta); |
| | | } elseif (is_post_type_archive($based) ) { |
| | | $config = $this->getConfig('archive'); |
| | | $title = $config['name']; |
| | | $title = Resolver::resolve($config['name'], null); |
| | | } elseif (is_tax($based)) { |
| | | $config = $this->getConfig('archive'); |
| | | $meta = Meta::forTerm(get_queried_object_id()); |