Skip to content

Instantly share code, notes, and snippets.

<!-- wp:group {"className":"hero-scroll-container glow glow-light","layout":{"type":"constrained"}} -->
<div class="wp-block-group hero-scroll-container glow glow-light"><!-- wp:group {"align":"full","className":"hero-scroll","style":{"spacing":{"blockGap":"var:preset|spacing|small"}},"layout":{"type":"flex","flexWrap":"nowrap","verticalAlignment":"top"},"blockVisibility":{"controlSets":[{"id":1,"enable":true,"controls":{"screenSize":{"hideOnScreenSize":{"small":true,"medium":true}}}}]}} -->
<div class="wp-block-group alignfull hero-scroll"><!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|small"}},"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:image {"id":57349,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://olliewp.com/wp-content/uploads/2024/05/Frame-1597881480-jpg.webp" alt="Frame 1597881480" class="wp-image-57349"/></figure>
<!-- /wp:image -->
<!-- wp:image {"id":57350,"sizeSlug":"full"
@robin-scott
robin-scott / functions.php
Last active January 30, 2022 12:14
Remove out of stock products from WooCommerce Related products
// remove OOS products from related products in WooCommerce, because they are OOS! by Robin Scott of silicondales.com - see more at https://silicondales.com/tutorials/woocommerce/remove-out-of-stock-products-from-woocommerce-related-products/
add_filter( 'woocommerce_related_products', 'exclude_oos_related_products', 10, 3 );
function exclude_oos_related_products( $related_posts, $product_id, $args ){
$out_of_stock_product_ids = (array) wc_get_products( array(
'status' => 'publish',
'limit' => -1,
'stock_status' => 'outofstock',
'return' => 'ids',
) );
@mrwweb
mrwweb / readme.md
Last active September 27, 2024 22:29
The Events Calendar v2 Template Reset & Customizations - Now on Github
@jessepearson
jessepearson / functions.php
Last active October 7, 2020 13:14
Adds the product link to low and out of stock emails in WooCommerce
<?php // do not copy this line
/**
* Adds the product link to low and out of stock emails in WooCommerce
* @param string $message Message stating low/out of stock.
* @param object $product The product's object the email is for.
* @return string The modified email with the link to edit the product.
*
* @link https://wordpress.org/support/topic/admin-stock-notification-emails/
* @link https://gist.github.com/jessepearson/701386d8ca5e4c84fc7cdf3d5d5391a3
@0x8801
0x8801 / export.js
Last active May 31, 2021 09:06
Export Wallet by BudgetBakers records to JSON
// Source for Jake Archibald's idb https://github.com/jakearchibald/idb/blob/v3.0.2/build/idb.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.idb = {}));
}(this, function (exports) { 'use strict';
function toArray(arr) {
return Array.prototype.slice.call(arr);
}
@damiencarbery
damiencarbery / conditional-wc-email-sending.php
Last active July 30, 2023 07:32
Conditionally send WooCommerce emails: Dynamically determine whether to send a WooCommerce email. https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/
<?php
/*
Plugin Name: Conditionally send WooCommerce emails
Plugin URI: https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/
Description: Dynamically determine whether to send a WooCommerce email.
Author: Damien Carbery
Version: 0.2
*/
// The filter name is 'woocommerce_email_enabled_'.WC_Email::id e.g. 'new_order', 'cancelled_order' etc
@JayHoltslander
JayHoltslander / deactivate-plugins-on-domain.php
Last active April 25, 2023 18:40 — forked from subharanjanm/deactivate-plugins-wpe-staging.php
Deactivate certain Wordpress plugins when running on the development/staging domain
<?php
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$plugins = array(
'wordpress-seo/wp-seo.php',
'broken-link-checker/broken-link-checker.php'
);
if ( strpos(get_site_url(), 'devserver.com') !== false ) {
deactivate_plugins( $plugins );
}
else {
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active July 7, 2025 09:00
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@findingsimple
findingsimple / .htaccess
Created November 28, 2017 07:58
HTTP_AUTHORIZATION modification for WP .htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@cliffordp
cliffordp / functions.php
Last active February 6, 2022 13:26
Event Tickets Plus v4.6+: Assign all WooCommerce Tickets to a specific Product Category upon saving (create or update, won't affect old tickets).
<?php
/*
* Event Tickets Plus v4.6+: Assign all WooCommerce Tickets to a specific
* Product Category upon saving (create or update, won't affect old tickets).
*
* !!! YOU NEED TO CHANGE THE CODE TO BE THE PRODUCT CATEGORY ID(S) YOU WANT !!!
*
* @link https://gist.github.com/cliffordp/5bffd372db4ebf14482574ce9bb2479c This snippet.
* @link https://gist.github.com/cliffordp/63abddea69b60f616c1aec1c6bdfc299 Another snippet you might be interested in.