Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @package KIA Subtitle
* @category Compatibility Class
* @version 3.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
@helgatheviking
helgatheviking / add-win-terminal-ubuntu-profile-to-context-menus.reg
Last active December 27, 2024 09:58
Add "Open Ubuntu Terminal Here" to context menus - Launches Windows Terminal's Ubuntu profile.
Windows Registry Editor Version 5.00
Replace <<Username>> with your user name!
[HKEY_CLASSES_ROOT\Directory\Background\shell\ubuntu]
@="Open Ubuntu Terminal here"
"Icon"="%USERPROFILE%/AppData/Local/WindowsTerminal/ubuntu.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\ubuntu\command]
@="C:\\Users\\<<Username>>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -d . --profile=\"Ubuntu-18.04\""
@helgatheviking
helgatheviking / class-wc-kia-class-email.php
Last active August 6, 2024 03:08
Send a WooCommerce Customer email from the Order Admin Actions
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! class_exists( 'WC_KIA_Class_Email', false ) ) :
/**
* A custom Order WooCommerce Email class
*
* @since 0.1
* @extends \WC_Email
@helgatheviking
helgatheviking / wc-optional-redirect-to-checkout.php
Last active June 30, 2024 08:19
Woo Redirect Certain Products to Checkout- How to skip cart page on woocomerce for certain products only?
<?php
/**
* Plugin Name: WC Redirect to checkout
* Plugin URI: http://stackoverflow.com/q/32962653/383847
* Description: Redirect to checkout for certain products
* Version: 1.0.1
* Author: Kathy Darling
* Author URI: http://kathyisawesome.com
* Requires at least: 3.8
* Tested up to: 3.9
@helgatheviking
helgatheviking / entry-header.php
Created April 19, 2020 19:53
Tweny Twenty Child theme | Add Subtitle to entry-header.php
<?php
/**
* Displays the post header
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
$entry_header_classes = '';
@helgatheviking
helgatheviking / wc-disable-billing-address-for-free-checkout.php
Created April 17, 2020 16:59
Hide billing address fields in checkout when cart total is free
<?php
/*
* Plugin Name: Disable billing address for free checkout
* Plugin URI: https://gist.github.com/helgatheviking/65fd213e7f13cde029b19c16a275eb3f
* Description: Hiding billing address fields when cart total is free.
* Version: 1.0.0
* Author: Kathy Darling
* Author URI: https://woocommerce.com/products/name-your-price?aff=5151&cid=4951026
* Requires at least: 5.3
* WC requires at least: 4.0
@helgatheviking
helgatheviking / wc-mnm-price-range.php
Created March 2, 2020 17:31
Change Mix and Match price string from From: $99 to range style $99 - $100
<?php
/**
* Change price string from From: $99 to range style $99 - $100
*
* @return string
*/
function kia_mnm_price_range( $price, $product ) {
if ( $product->get_max_container_size() && $product->get_mnm_price( 'max' ) && $product->get_mnm_price( 'min' ) !== $product->get_mnm_price( 'max' ) ) {
$price = sprintf( _x( '%1$s - %2$s', 'Price range', 'woocommerce-mix-and-match-products' ), $price . $product->get_price_suffix(), $product->get_mnm_price( 'max' ) . $product->get_price_suffix() );
@helgatheviking
helgatheviking / wc-mnm-disable-shipstation-compat.php
Created March 2, 2020 17:04
Mix and Match: Disable Shipstation Compat
<?php
/**
* Plugin Name: Mix and Match: Disable Shipstation Compat
* Plugin URI: https://woocommerce.com/products/woocommerce-mix-and-match-products/?aff=5151&cid=4347782
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
* Version: 1.0.0
* Author: Kathy Darling
* Author URI: kathyisawesome.com
* License: GPL-2.0+
@helgatheviking
helgatheviking / custom-meta-for-woocommerce-product-variations.php
Last active January 8, 2025 12:43
Add custom fields to WooCommerce variations
<?php
/**
* Plugin Name: Example custom variation meta for WooCommerce
* Plugin URI: hhttps://www.kathyisawesome.com/add-custom-meta-fields-to-woocommerce-variations/
* Description: Add thickness and diameter fields to variations.
* Version: 6.22.5
* Author: Kathy Darling
* Author URI: https://kathyisawesome.com/
*
* Text Domain: extra-product-data
@helgatheviking
helgatheviking / wordpress-add-custom-menu-meta-fields.php
Created February 26, 2020 02:06
Add an example custom meta field to WordPress menu and display text on front-end (Requires WP5.4)
<?php
/**
* Add custom fields to menu item
*
* This will allow us to play nicely with any other plugin that is adding the same hook
*
* @param int $item_id
* @params obj $item - the menu item
* @params array $args