Skip to content

Instantly share code, notes, and snippets.

@esedic
esedic / wc-complete.php
Created October 27, 2026 09:48
Display a “Complete Order” Button @ WooCommerce Single Order Edit Page
<?php
/**
* @snippet Complete Order Button @ WooCommerce Order Admin
* @tutorial https://businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 9
* @community https://businessbloomer.com/club/
*/
@esedic
esedic / wc-auto-cancel.php
Created October 27, 2026 09:47
WooCommerce: Limit Payment Retries on Failed Orders @ WooCommerce Order Pay Page (WooCommerce Stripe Payment Gateway)
<?php
/**
* @snippet Max 3 Stripe Payment Retries @ WooCommerce Order Pay
* @tutorial https://businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 9
* @community https://businessbloomer.com/club/
*/
@esedic
esedic / wc-admin.php
Last active October 27, 2026 09:41
WooCommerce: Distraction-Free WP Admin for Store Management
<?php
/**
* @snippet "Store Admin" View @ WordPress Dashboard
* @tutorial https://businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 10
* @community https://businessbloomer.com/club/
*/
@esedic
esedic / min_max_gf.php
Created September 1, 2026 15:04
Require Minimum and Maximum Character Limit for Gravity Forms
<?php
/**
* Gravity Wiz // Gravity Forms // Require Minimum and Maximum Character Limit for Gravity Forms
* https://gravitywiz.com/require-minimum-character-limit-gravity-forms/
*
* Adds support for requiring a minimum and maximum number of characters for text-based Gravity Form fields.
*
* Plugin Name: Gravity Forms - Require Minimum and Maximum Character Limit
* Plugin URI: https://gravitywiz.com/require-minimum-character-limit-gravity-forms/
* Description: Adds support for requiring a minimum and maximum number of characters for text-based Gravity Form fields.
@esedic
esedic / auto_complete_free_digital_orders.php
Created August 7, 2026 08:50
Samodejno zaključi brezplačna digitalna naročila (0,00 €). Deluje samo za naročila, ki vsebujejo izključno virtualne/prenosljive izdelke.
/**
* Samodejno zaključi brezplačna digitalna naročila (0,00 €).
* Deluje samo za naročila, ki vsebujejo izključno virtualne/prenosljive izdelke.
*/
add_filter( 'woocommerce_payment_complete_order_status', 'auto_complete_free_digital_orders', 10, 3 );
function auto_complete_free_digital_orders( $status, $order_id, $order ) {
// Varnostna preverba
if ( ! $order instanceof WC_Order ) {
@esedic
esedic / field-ids-in-editor-labels.php
Created August 7, 2026 08:41
Display Field IDs Next to Field Labels in the Gravity Forms Editor
<?php
/**
* Gravity Wiz // Gravity Forms // Display Field IDs Next to Field Labels in the Editor
* https://gravitywiz.com/
*
* Experimental Snippet 🧪
*
* Instruction Video: https://www.loom.com/share/0268993d0b6c429ba50686bd740093bc
*
*/
@esedic
esedic / gallerynav.js
Created February 20, 2026 13:26
hribi.net gallery arrow keys navigation Violentmonkey Script
// ==UserScript==
// @name hribi.net gallery arrow keys
// @namespace Violentmonkey Scripts
// @match https://www.hribi.net/*
// @grant none
// @version 1.0
// @author -
// @description 5/3/2025, 7:04:37 PM
// ==/UserScript==
const backButton = document.querySelector('.slikanazaj > a');
@esedic
esedic / gberg.php
Created February 19, 2026 08:41
Remove WordPress Gutenberg Block Library CSS from loading on the frontend
//Remove Gutenberg Block Library CSS from loading on the frontend
function smartwp_remove_wp_block_library_css(){
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css' );
@esedic
esedic / sql.txt
Created February 5, 2026 15:34
Restore MySQL database backup in Laragon (when upgrading MySQL)
mysql -u root -p < C:\laragon\backup\mysql\xxx.sql
@esedic
esedic / cli.bat
Created February 5, 2026 15:32
Add WP CLI to Laragon on Windows
cd C:\laragon\usr\bin && curl -L -O https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && echo @ECHO OFF > wp.bat && echo php "%~dp0wp-cli.phar" %* >> wp.bat