Admin Area—Prevent Mouse Scroll Changing Number Inputs

function preventNumberScroll(e) { if (e.target.matches(‘input[type=”number”]’) || e.target.closest(‘input[type=”number”]’)) { e.preventDefault(); } } document.addEventListener(‘wheel’, preventNumberScroll, { passive: false, capture: true }); document.addEventListener(‘mousewheel’, preventNumberScroll, { passive: false, capture: true }); document.addEventListener(‘DOMMouseScroll’, preventNumberScroll, { passive: false, capture: true });Continue reading

RED’S Java Snippet

fetch(“https://redllc.ai/wp-json/chaport/v1/lead”, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify(payload) }) .then(res => res.json()) .then(data => { console.log(“Webhook response:”, data); }) .catch(err => { console.error(“Error:”, err); });Continue reading

WPBakery Collapse All Rows

(function($) { ‘use strict’; /** * WP Bakery – Collapse / Expand All Rows (v3) * Fixed: injects buttons into the correct visible navbar list position * Fixed: iterates ROWS not individual toggles (avoids multi-click cancellation) */ function getFirstToggle(rowEl) {…Continue reading

admin footer many ( Mihai )

function sg24_prettyTime() { return moment().format(‘h:mm:ss A’); } function sg24_sleepAndPrint(ms) { return new Promise(resolve => setTimeout(() => { console.log(“Slept for “+ms+” ms and now its “+sg24_prettyTime()); // Print the formatted time using Moment.js resolve(); // Resolve the promise after the time…Continue reading

Collapsed Menu Reset for Mobile Menu

/** * WordPress admin menu handler – UiPress direct approach */ (function($) { // Execute when document is ready $(document).ready(function() { // Set up the mobile menu click handler setupMobileHandler(); // Also handle resize events $(window).on(‘resize’, debounce(function() { setupMobileHandler(); },…Continue reading

Admin Menu Separator Class

/** * WordPress Admin Menu Separator Class – Updated * * This script targets the specific structure of the admin menu separators * and adds the “bshSeparator” class to the parent container */ (function() { // Function to add classes…Continue reading