From d7e7d248cbe41cd7a9ef9c2fb022b6c4831f99a3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 31 May 2026 15:22:56 +0000
Subject: [PATCH] =jakevan complete
---
jvb.php | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/jvb.php b/jvb.php
index d400ce2..0fcddcc 100644
--- a/jvb.php
+++ b/jvb.php
@@ -20,6 +20,18 @@
exit;
}
+//add_action('admin_enqueue_scripts', function() {
+// global $wp_scripts;
+// add_action('admin_print_scripts', function() use ($wp_scripts) {
+// $queue = $wp_scripts->queue ?? [];
+// foreach ($queue as $handle) {
+// $src = $wp_scripts->registered[$handle]->src ?? 'unknown';
+// error_log("Enqueued: $handle => $src");
+// }
+// }, 999);
+//}, 999);
+
+
/**
* Track REST API errors by wrapping request execution
*/
@@ -83,6 +95,7 @@
define('JVB_TESTING', str_contains(get_home_url(),'.test'));
+//const JVB_TESTING = false;
//if (!JVB_TESTING) {
add_filter('show_admin_bar', '__return_false');
@@ -141,6 +154,13 @@
return IconsManager::for($source)->get($name, $options);
}
+function jvbFullIcon(string $name, array $options = []):string
+{
+ $source = $options['source'] ?? 'icons';
+ unset($options['source']);
+ return IconsManager::for($source)->getRawSvg($name, $options['style']??null);
+}
+
/**
* Get a CSS data URI for an icon
*
@@ -503,6 +523,13 @@
echo '<div class="screen-reader-text live-region" aria-live="polite" role="status"></div>';
}
+add_action('wp_head', 'jvbFrontendBase',1);
+function jvbFrontendBase():void
+{
+ ?>
+ <script type="text/javascript">window.jvbBase = '<?= BASE ?>';</script>
+ <?php
+}
//add_action('wp_head', 'jvbDumpIt');
function jvbDumpIt()
@@ -550,3 +577,20 @@
}
return $result;
}, 99);
+
+
+add_action('wp_footer', 'jvb_back_to_top');
+function jvb_back_to_top():void
+{
+ echo sprintf(
+ '<a id="back-to-top" class="btn sticky" href="#">%s<span>Back to Top</span></a>',
+ jvbIcon('caret-double-up')
+ );
+}
+
+add_action( 'doing_it_wrong_run', function ( $function_name ) {
+ if ( '_load_textdomain_just_in_time' === $function_name ) {
+ // This will print the full execution path to your screen or log
+ debug_print_backtrace();
+ }
+} );
--
Gitblit v1.10.0