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/utility/Image.php | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/inc/utility/Image.php b/inc/utility/Image.php
index b888008..0626891 100644
--- a/inc/utility/Image.php
+++ b/inc/utility/Image.php
@@ -81,7 +81,7 @@
$postSlug = jvbNoBase($tax->taxonomy);
}elseif (is_post_type_archive()) {
$obj = get_queried_object();
- $postSlug = jvbNoBase($obj->post_type);
+ $postSlug = jvbNoBase($obj->name);
}
}
@@ -160,4 +160,30 @@
return (new Image)->getImageData($imgID);
}
+ public static function gallery(string $ids, ?string $type = null):string
+ {
+ $ids = explode(',', $ids);
+ $inner = implode('', array_map(function ($ID) {
+ $caption = wp_get_attachment_caption($ID);
+ if (!empty($caption)) {
+ $caption = sprintf('<figcaption>%s</figcaption', $caption);
+ }
+ return sprintf(
+ '<li><figure>%s%s</figure></li>',
+ self::image($ID),
+ $caption
+ );
+ }, $ids));
+ return sprintf(
+ '<ul class="gallery%s">%s</ul>',
+ $type? ' '.$type : '',
+ $inner
+ );
+ }
+
+ public static function image(int $id, string $start = 'tiny', string $replace = 'large', bool $addLink = true, ?string $postSlug = null):string
+ {
+ return (new Image)->formatImage($id, $start, $replace, $addLink, $postSlug);
+ }
+
}
--
Gitblit v1.10.0