From a9b3b28d001941921aa70d37fdc87c758a163a44 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 05 Jun 2026 16:47:03 +0000
Subject: [PATCH] =Some hefty changes to FeedBlock. Transitioning to loading first page in php to save on extra requests. Got a bit to do yet, but I have to work on Northeh for a bit here.

---
 inc/managers/queue/executors/UploadExecutor.php |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/inc/managers/queue/executors/UploadExecutor.php b/inc/managers/queue/executors/UploadExecutor.php
index 11fec65..ac659a4 100644
--- a/inc/managers/queue/executors/UploadExecutor.php
+++ b/inc/managers/queue/executors/UploadExecutor.php
@@ -329,6 +329,7 @@
 				$postID = wp_get_post_parent_id($attachmentId);
 				if ($postID && !in_array($postID, $postsAttachedTo)){
 					$postsAttachedTo[] = $postID;
+					//TODO: is there a better way?
 				}
 			}
 
@@ -638,7 +639,7 @@
 
 					foreach($childPosts as $i => $imgID) {
 						$treatment = $i + 1;
-						$child = $this->createTimelinePoint($imgID, $parent, $args['user'], $args['post_type'], $title, $treatment);
+						$child = $this->createTimelinePoint($imgID, $parent, $args['post_author'], $args['post_type'], $title, $treatment);
 						if ($child && !is_wp_error($child) && $child> 0 ) {
 							$createdChildren[] = $child;
 							$usedUploads[] = $imgID;
@@ -681,14 +682,7 @@
 	private function updateTimelineMetadata(int $parentId): void
 	{
 		// Get all child posts
-		$children = get_children([
-			'post_parent' => $parentId,
-			'post_type' => get_post_type($parentId),
-			'post_status' => ['publish', 'draft'],
-			'orderby' => 'date',
-			'order' => 'DESC',
-			'fields' => 'ids'
-		]);
+		$children = jvbTimelinePoints($parentId, get_post_type($parentId), ['any']);
 
 		// Count includes parent + children
 		$number = count($children) + 1;

--
Gitblit v1.10.0