From 772462eeca3002a1d52508aeba485aab2b4742ad Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 03 Mar 2026 19:06:19 +0000
Subject: [PATCH] =MAJOR OVERHAUL. Likely should have made a new branch ages ago. Key changes: Registrar.php is the base for custom post types, taxonomies, and user roles. Replaces JVB_CONTENT, JVB_TAXONOMY, and JVB_USER constants, eliminates most of Features.php (except for JVB_SITE, JVB_MEMBERSHIP), and has built in sanitizing and validation via sub-classes. Also started a major overhaul of the Schema output. Created a shit ton of property traits and classes to help sanitize and ensure proper data for different schema types. Still a bunch to do, but better to be starting committing changes here on this other branch.
---
inc/blocks/VideoCoverBlock.php | 29 ++++++-----------------------
1 files changed, 6 insertions(+), 23 deletions(-)
diff --git a/inc/blocks/VideoCoverBlock.php b/inc/blocks/VideoCoverBlock.php
index 298ee76..d6e753e 100644
--- a/inc/blocks/VideoCoverBlock.php
+++ b/inc/blocks/VideoCoverBlock.php
@@ -1,7 +1,6 @@
<?php
namespace JVBase\blocks;
-use JVBase\blocks\CustomBlocks;
if (!defined('ABSPATH')) {
exit;
}
@@ -55,15 +54,17 @@
//Get date of current post
global $post;
$date = date('c',strtotime($post->post_date));
- $title = $attributes['title'] ?? $post->post_title;
- $description = $attributes['description'] ?? $post->post_excerpt;
- $title = "Legacy Tattoo Removal";
- $description="A video of Madi Rawson performing laser tattoo removal treatments.";
+
// If no video sources, return empty
if (empty($video_sources)) {
return '';
}
+ $video_id = $video_sources[0]['id'] ?? 0;
+ $video_post = $video_id ? get_post($video_id) : null;
+ $title = $video_post->post_title ?? $post->post_title;
+ $description = $video_post->post_content ?? $post->post_excerpt;
+
// Get poster URL
@@ -95,29 +96,11 @@
$html .= ' fetch-priority="high">';
- // Add mobile sources first (lower resolution)
- foreach ($mobile_sources as $source) {
- if (!empty($source['url']) && !empty($source['mime'])) {
- $html .= '<source';
- $html .= ' data-src="' . esc_url($source['url']) . '"';
- $html .= ' type="' . esc_attr($source['mime']) . '"';
- $html .= ' media="(max-width: 767px)"';
- $html .= '>';
- }
- }
-
- // Add desktop sources
foreach ($video_sources as $source) {
if (!empty($source['url']) && !empty($source['mime'])) {
$html .= '<source';
$html .= ' data-src="' . esc_url($source['url']) . '"';
$html .= ' type="' . esc_attr($source['mime']) . '"';
-
- // Add media query for desktop if mobile sources exist
- if (!empty($mobile_sources)) {
- $html .= ' media="(min-width: 768px)"';
- }
-
$html .= '>';
}
}
--
Gitblit v1.10.0