Skip to content

Instantly share code, notes, and snippets.

View stoffl6781's full-sized avatar

Christoph Purin - Stoffl/OE9CPV stoffl6781

View GitHub Profile
@stoffl6781
stoffl6781 / readme.md
Last active September 23, 2025 08:41
Gutenbricks simpel slider

Splide Auto-Wrap for Bricks + Gutenberg (Gutenbricks)

This script fixes structural issues when using Splide sliders with Bricks Builder and Gutenbricks InnerBlocks.

Problem

  • Gutenberg may insert multiple <figure> elements (image blocks) inside a single Gutenbricks InnerBlock wrapper.
  • Bricks sometimes incorrectly applies .splide__slide classes to the wrapper instead of individual slides.
  • Splide requires the following structure:
@stoffl6781
stoffl6781 / gutenberg-font-style.php
Last active September 23, 2025 07:07
gutenberg-font-style.php
<?php
/**
* Gutenberg Inline Toolbar: "THIN" Button (font-weight: 100)
*
* Adds a small "THIN" button to the contextual inline toolbar (the one with Bold/Italic)
* in the block editor. When clicked (or via the shortcut), it wraps the current selection
* inside <span data-fw="100" style='font-weight:100; font-variation-settings:"wght" 100;'>…</span>.
* Clicking again on a selection that is fully wrapped will unwrap it (toggle behavior).
*
* Keyboard shortcut: Ctrl/Cmd + Alt + 1
jQuery(function ($) {
let timeout;
const registerUpdateCartEvent = () => {
$(".woocommerce-cart-form").on("change", "input.qty", function () {
if (timeout !== undefined) {
clearTimeout(timeout);
}
timeout = setTimeout(function () {
$("[name='update_cart']").trigger("click");
function clp_clear_varnish_cache() {
if (class_exists('ClpVarnishCacheManager')) {
$manager = new ClpVarnishCacheManager();
$host = $_SERVER['HTTP_HOST'] ?? '';
if (!empty($host)) {
$manager->purge_host($host);
$tag = $manager->get_cache_tag_prefix();
if (!empty($tag)) {
/*
* Try to change IN from a specivic Filter to NOT IN over Query_vars Bricks filter.
*
*/
add_filter( 'bricks/query_filters/filter_query_vars', function( $query_vars, $filter, $query_id, $index ){
$filter_id = $filter['filter_id'] ?? '';
$allowed_filters = array( 'opuozx', 'nbhbmt'); //Bricks Widget Filter ID'S (Array)
<?php
// === MainWP Bricks Dynamic Tags ===
// Dynamic Tags für verschiedene MainWP API Endpunkte
define('MAINWP_API_URL', 'https://YOUR_MAIN_WP_URL_HOST_HERE/wp-json/mainwp/v2/');
define('MAINWP_API_TOKEN', 'Bearer YOUR_TOKEN_HERE'); // <-- Token hier eintragen
// Tag-Konfiguration (Felder, Gruppen, Endpunkte)
function mainwp_get_tag_sources() {
return [
@stoffl6781
stoffl6781 / bricks builder css
Created March 10, 2025 14:08
Bricksbuilder tweaks
/* --- Make highlight of the active element in structure more prominent --- */
#bricks-structure .element.active>.structure-item {
background-color: var(--builder-color-accent);
}
#bricks-structure .element.active>.structure-item input,
#bricks-structure .element.active>.structure-item>.title input,
#bricks-structure .element.active>.structure-item>.title i,
#bricks-structure .element.active .structure-item .more {
color: #000;
@stoffl6781
stoffl6781 / install_wp.bat
Last active April 19, 2024 22:41
WordPress BAT XAMPP Installation
@echo off
setlocal enabledelayedexpansion
echo Checking if XAMPP is installed...
if exist "C:\xampp\xampp-control.exe" (
set XAMPP_DIR=C:\xampp
) else (
echo XAMPP not found at the default location.
set /p XAMPP_DIR="Please enter your XAMPP installation path (e.g., D:\xampp): "
if not exist "!XAMPP_DIR!\xampp-control.exe" (
$args = array(
'post_type' => 'event',
'meta_query' => array(
'relation' => 'AND',
'event_start_date_clause' => array(
'key' => '_event_start_date',
'compare' => 'EXISTS',
),
'event_start_time_clause' => array(
'key' => '_event_start_time',