From f383c3a4325bc173b6f9676274bc19694be6f9c0 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 05 Jun 2026 16:49:44 +0000
Subject: [PATCH] =Modified the Feed Fields config in Registrar, to utilize the built in functionality there
---
blocks/_setup.php | 44 +++++++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/blocks/_setup.php b/blocks/_setup.php
index e232442..9237bdf 100644
--- a/blocks/_setup.php
+++ b/blocks/_setup.php
@@ -1,6 +1,6 @@
<?php
-function altr_render_core_site_logo(array $block, string $content):string
+function altr_prerender_core_site_logo(array $block, ?string $content):?string
{
$open = $close = '';
@@ -12,7 +12,7 @@
}
-function altr_render_core_post_excerpt(array $block, string $content)
+function altr_prerender_core_post_excerpt(array $block, ?string $content):?string
{
global $post;
@@ -26,10 +26,10 @@
return '<div class="excerpt">'.apply_filters('the_content', $excerpt).'</div>';
}
-function altr_render_core_media_text(array $block, string $content):string
+function altr_prerender_core_media_text(array $block, ?string $content, ?WP_Block $parent):?string
{
if (!array_key_exists('attrs', $block) || !array_key_exists('className', $block['attrs']) || $block['attrs']['className'] !== 'ltr-logo'){
- return JVB()->blocks()->render_core_media_text($block, $content);
+ return JVB()->blocks()->prerender_core_media_text($block, $content, $parent);
}
$imgs = [
@@ -45,12 +45,12 @@
'alt' => 'A signature script of the words "Legacy Tattoo Removal" by Edmonton tattoo artist Dave Huns of Blvck Chapel',
'slug' => 'dave-huns'
],
-// [
-// 'title' => 'Edmonton tattoo artist Jon Squires of Homesick Tattoos',
-// 'img' => 'Jon Squires Pinup',
-// 'alt' => 'A two-headed pinup girl (with Madi and Heidi\'s heads) by Edmonton tattoo artist Jon Squires of Homesick Tattoos',
-// 'slug' => 'jon-squires'
-// ],
+ [
+ 'title' => 'Edmonton tattoo artist Jon Squires of Homesick Tattoos',
+ 'img' => 'Jon Squires Pinup',
+ 'alt' => 'A two-headed pinup girl (with Madi and Heidi\'s heads) by Edmonton tattoo artist Jon Squires of Homesick Tattoos',
+ 'slug' => 'jon-squires'
+ ],
[
'title' => 'Sherwood Park tattoo artist Scott Rusnak',
'img' => 'Scott Rusnak Kitsune',
@@ -73,9 +73,31 @@
<p>See the Difference</p>
</div>
</div>',
- '#'.$imgs[$rand]['slug'],
+ get_home_url(null, '/tattoo-artist-logos/').'#'.$imgs[$rand]['slug'],
$imgs[$rand]['title'],
AJV_URL.'/assets/img/'.$imgs[$rand]['img'].'.png',
$imgs[$rand]['alt'],
);
+}
+
+function altr_prerender_core_quote(array $block, ?string $content, ?WP_Block $parent):?string
+{
+ $innerHTML = $block['innerHTML'];
+ $handler = JVB()->blocks();
+ // Extract cite content first
+ $cite = $handler->extractElement($innerHTML, 'cite');
+ $citeHtml = ($cite === '') ? '' : '<cite>— '.$cite.'</cite>';
+
+ // Get the blockquote content
+ $content = $handler->innerBlocks($block);
+
+ // Remove the cite element from content if it exists
+ if ($cite !== '') {
+ $content = $handler->stripTagContents('cite', $content);
+ }
+
+ return '<blockquote'.$handler->getClassesAndStyles($block['attrs']??[]).'>
+ <div class="content">'.$content.'</div>'.
+ $citeHtml.
+ '</blockquote>';
}
\ No newline at end of file
--
Gitblit v1.10.0