From ccf5e61a075c35d24befc175994b5cb8957ca322 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 26 Aug 2026 21:45:53 +0000
Subject: [PATCH] =Extra JVB() calls replaced, minor tweaks

---
 inc/managers/queue/executors/ContentExecutor.php |   27 ++++++++-------------------
 1 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/inc/managers/queue/executors/ContentExecutor.php b/inc/managers/queue/executors/ContentExecutor.php
index 55835f0..bc6ee4b 100644
--- a/inc/managers/queue/executors/ContentExecutor.php
+++ b/inc/managers/queue/executors/ContentExecutor.php
@@ -2,6 +2,7 @@
 namespace JVBase\managers\queue\executors;
 
 use JVBase\managers\queue\{Executor, Operation, Progress, Result, Storage};
+use JVBase\managers\Errors;
 use JVBase\meta\Meta;
 use JVBase\registrar\Registrar;
 use Exception;
@@ -43,7 +44,7 @@
 			};
 
 		} catch (Exception $e) {
-			JVB()->error()->log(
+			Errors::getInstance()->log(
 				'[ContentExecutor]:execute',
 				$e->getMessage(),
 				[
@@ -125,7 +126,7 @@
 
 		// Send notification
 //		if (jvbSiteHasNotifications()) {
-//			JVB()->notification()->addNotification(
+//			NotificationManager::getInstance()->addNotification(
 //				$this->userId,
 //				'content_update_complete',
 //				null,
@@ -249,12 +250,7 @@
 			return [];
 		}
 
-		$children = get_children([
-			'post_parent' => $parentID,
-			'posts_per_page' => -1,
-			'post_status' => ['publish', 'draft'],
-		]);
-
+		$children = jvbTimelinePoints($parentID, $parent->post_type, ['publish', 'draft']);
 
 		if (count($children) === 0) {
 			return [];
@@ -465,11 +461,7 @@
 			$meta = Meta::forPost($parentID);
 			$values = $meta->getAll($shared);
 
-			$children = get_children([
-				'post_parent' => $parentID,
-				'posts_per_page' => -1,
-				'fields' => 'ids',
-			]);
+			$children = jvbTimelinePoints($parentID, get_post_type($parentID), ['any']);
 
 			if (empty($children)) {
 				continue;
@@ -488,11 +480,8 @@
 		});
 
 		foreach ($updates as $parentID => $status) {
-			$children = get_children([
-				'post_parent'	=> $parentID,
-				'posts_per_page' => -1,
-				'fields'	=> 'ids'
-			]);
+			$children = jvbTimelinePoints($parentID, get_post_type($parentID), ['any']);
+
 			if (!empty($children)) {
 				foreach($children as $child) {
 					if ($status === 'trash') {
@@ -608,7 +597,7 @@
 	{
 		error_log('Handling term '.$ID.' with data: '.print_r($data, true));
 		//Existing term update
-		if ($registrar->hasFeature('is_ownable') && (!JVB()->roles()->isOwner($this->userId, $ID) && !JVB()->roles()->isManager($this->userId, $ID))) {
+		if ($registrar->hasFeature('is_ownable') && (!Roles::getInstance()()->isOwner($this->userId, $ID) && !Roles::getInstance()()->isManager($this->userId, $ID))) {
 			error_log('Term is ownable. User does not own this term.');
 			$progress->failItem($ID, 'No permission to modify this term');
 			$results['errors'][$ID] = 'No permission';

--
Gitblit v1.10.0