Skip to content

Instantly share code, notes, and snippets.

@SRHDesign
SRHDesign / README.md
Last active November 5, 2025 22:12
Elementor + ACF Product Accordions - Complete system with auto-cleanup"

Elementor + ACF Product Accordions System

A complete solution for managing dynamic product accordions in WooCommerce using Elementor and Advanced Custom Fields (ACF).

📦 What's Included

  1. JavaScript Optimizer - Automatically cleans empty accordions and fixes video loading
  2. ACF Field Group - Pre-configured fields for 5 product accordions
  3. Complete Integration - Works seamlessly with Elementor's nested accordion widget
@SRHDesign
SRHDesign / README.md
Last active November 12, 2025 10:04
WooCommerce AutoComplete with Classic Checkout and Block Checkout

WooCommerce AutoComplete with Classic Checkout and Block Checkout in WooCommerce

A lightweight, accessible WordPress plugin that adds Google Places address autocomplete to WooCommerce checkout pages. Built with WCAG AAA accessibility standards and full support for both classic and block-based checkouts.

🌟 Features

  • New Google Places API - Uses the latest REST-based Places API (v1)
  • Universal Checkout Support - Works with both classic shortcode and block-based checkouts
  • Session Token Optimization - Efficient billing with proper session token management
  • Multi-Region Support - Configurable country restrictions
Alternative 1
----------------
/**
* Prevent duplicate image uploads based on file name.
*/
function prevent_duplicate_image_upload( $file ) {
// Only act on image uploads
if ( strpos( $file['type'], 'image/' ) !== 0 ) {
return $file;
@diggeddy
diggeddy / gp-mega-menu.php
Last active December 17, 2024 11:58
Create a sub menu item container with action hook
<?php
add_filter( 'walker_nav_menu_start_el', 'db_sub_menu_item_hook', 10, 4 );
function db_sub_menu_item_hook( $item_output, $item, $depth, $args ) {
// Specify menu item class to target
$class_string = 'gp_mega_item';
$menu_item_classes = $item->classes;
if ( empty( $menu_item_classes ) || !in_array( $class_string , $menu_item_classes ) ) {
return $item_output;
@pcmoritz
pcmoritz / gist:4b0e1be7f2dfcc4e51e2ace50426f67d
Created May 20, 2018 19:04
Powerpoint create slides for animations while retaining slide numbers
Option Explicit
Sub AddElements()
Dim shp As Shape
Dim i As Integer, n As Integer
n = ActivePresentation.Slides.Count
For i = 1 To n
Dim s As Slide
Set s = ActivePresentation.Slides(i)
@vielhuber
vielhuber / .htaccess
Last active August 16, 2025 09:00
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@spigists
spigists / new_gist_file.css
Created October 2, 2013 16:16
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
@jgalea
jgalea / microtime.php
Last active December 7, 2022 01:30
Test execution time of WordPress PHP function
<?php
function my_function() {
$start = microtime(true);
// function code here
$time_taken = microtime(true) - $start;
wp_die( $time_taken ); // in seconds
}