Jake Vanderwerf
2026-03-03 772462eeca3002a1d52508aeba485aab2b4742ad
inc/managers/SEO/schemas/resolvers/PersonResolver.php
@@ -4,6 +4,7 @@
use JVBase\managers\SEO\schemas\SchemaDefinition;
use JVBase\managers\SEO\SchemaReferenceBuilder;
use JVBase\meta\Meta;
use JVBase\registrar\Registrar;
if (!defined('ABSPATH')) {
   exit;
@@ -50,17 +51,13 @@
    */
   private function buildWorksFor(int $userId): ?array
   {
      if (!defined('JVB_TAXONOMY')) {
      $contentTypes = Registrar::getFeatured('is_content', 'term');
      if (empty($contentTypes)) {
         return null;
      }
      // Find taxonomies that represent organizations (is_content taxonomies)
      foreach (JVB_TAXONOMY as $slug => $config) {
         if (empty($config['is_content'])) {
            continue;
         }
         $fullTax = BASE . $slug;
      foreach ($contentTypes as $content) {
         $fullTax = jvbCheckBase($content);
         $terms = wp_get_object_terms($userId, $fullTax);
         if (is_wp_error($terms) || empty($terms)) {
@@ -71,9 +68,8 @@
         $term = $terms[0];
         return SchemaReferenceBuilder::build(
            $term->term_id,
            'term',
            null
            $term->term_id
         );
      }
@@ -85,17 +81,24 @@
    */
   private function buildWorkExamples(int $userId, int $limit = 5): array
   {
      if (!defined('JVB_CONTENT')) {
      $role = jvbUserRole($userId);
      $registrar = Registrar::getInstance($role);
      if (!$registrar){
         return [];
      }
      $types = $registrar->getCreatable();
      if (empty($types)){
         return [];
      }
      $examples = [];
      foreach (JVB_CONTENT as $slug => $config) {
         $fullType = BASE . $slug;
      foreach ($types as $slug) {
         $type = jvbCheckBase($slug);
         $posts = get_posts([
            'post_type'      => $fullType,
            'post_type'      => $type,
            'author'         => $userId,
            'posts_per_page' => $limit,
            'post_status'    => 'publish',
@@ -106,7 +109,7 @@
            continue;
         }
         $refs = SchemaReferenceBuilder::buildMultiple($posts, 'post', null, true);
         $refs = SchemaReferenceBuilder::buildMultiple('post', $posts, null, true);
         if (!empty($refs)) {
            $examples = array_merge($examples, $refs);