Jake Vanderwerf
2026-08-28 a9654f00c8fbc9934289d761843ddd071025013f
inc/managers/queue/executors/ContentExecutor.php
@@ -1,11 +1,14 @@
<?php
namespace JVBase\managers\queue\executors;
use JVBase\managers\queue\{Executor, Operation, Progress, Result, Storage};
use DateTime;
use JVBase\managers\queue\{Executor, Operation, Progress, Result};
use JVBase\managers\Errors;
use JVBase\managers\Roles;
use JVBase\meta\Meta;
use JVBase\registrar\Registrar;
use Exception;
use WP_Post;
if (!defined('ABSPATH')) {
   exit;
@@ -23,8 +26,6 @@
   ];
   private int $userId;
   private string $postType;
   private array $fields = [];
   public function execute(Operation $operation, Progress $progress): Result
   {
@@ -135,8 +136,8 @@
//    }
      $outcome = 'success';
      if (!empty($errors)) {
         $outcome = count($errors) === count($posts) ? 'failed' : 'partial';
      if (!empty($results['errors'])) {
         $outcome = count($results['success']) === count($posts) ? 'failed' : 'partial';
      }
      return new Result(
@@ -361,7 +362,7 @@
      }
   }
   private function calculateTimeline(\WP_POST $previous, \WP_POST $current): ?string
   private function calculateTimeline(WP_POST $previous, WP_POST $current): ?string
   {
      $previousDate = strtotime($previous->post_date);
      $currentDate = strtotime($current->post_date);
@@ -379,8 +380,8 @@
         return $weeks === 1 ? '1 Week' : $weeks . ' Weeks';
      }
      $previousDateTime = new \DateTime($previous->post_date);
      $currentDateTime = new \DateTime($current->post_date);
      $previousDateTime = new DateTime($previous->post_date);
      $currentDateTime = new DateTime($current->post_date);
      $interval = $previousDateTime->diff($currentDateTime);
      $months = ($interval->y * 12) + $interval->m;
@@ -392,7 +393,7 @@
      return ($months === 1) ? '1 Month' : $months . ' Months';
   }
   private function swapTimelineParent(\WP_Post $oldParent, \WP_Post $newParent, array $allPosts): void
   private function swapTimelineParent(WP_Post $oldParent, WP_Post $newParent, array $allPosts): void
   {
      // Swap titles and content
      $originalTitle = $oldParent->post_title;
@@ -416,7 +417,7 @@
      ]);
      // Clear timeline taxonomy from new parent
      wp_set_object_terms($newParent->ID, [], BASE . 'timeline', false);
      wp_set_object_terms($newParent->ID, [], BASE . 'timeline');
      // Update all other posts to new parent
      foreach ($allPosts as $index => $post) {