Skip to content

Instantly share code, notes, and snippets.

View spigotdesign's full-sized avatar

Bryan Hoffman spigotdesign

View GitHub Profile
@spigotdesign
spigotdesign / reply-to-order-filter.php
Created December 29, 2018 17:04
Filter New Order email headers for WooCommerce
add_filter('woocommerce_email_header', 'spigot_reply_to_mail_filter', 11, 3);
function spigot_reply_to_mail_filter($headers = '', $ordertype = 'new_order', $order = '') {
if(!is_object($order) || empty($order) || $ordertype !== 'new_order') { return $headers; }
$name = $order->get_billing_first_name().' '.$order->get_billing_last_name();
$email = $order->get_billing_email();
@spigotdesign
spigotdesign / woo-enable-reviews-bulk-edit.php
Created November 20, 2018 18:52 — forked from mariovalney/woo-enable-reviews-bulk-edit.php
WooCommerce Enable Reviews - Bulk Edit
<?php
/**
*
* Plugin Name: WooCommerce Enable Reviews - Bulk Edit
* Description: Allow enable reviews by bulk edit into WooCommerce
* Version: 1.0.0
* Author: Mário Valney
* Author URI: http://mariovalney.com
* Text Domain: woo-enable-reviews-bulk-edit
*
<svg class="icon icon--twitter"><use xlink:href="#icon--twitter"></use></svg>
@spigotdesign
spigotdesign / hide-title.js
Created July 10, 2018 23:34
Hide title attribute on hover, but don't remove
$(".element").hover(function(){
// Get the current title
var title = $(this).attr("title");
// Store it in a temporary attribute
$(this).attr("tmp_title", title);
// Set the title to nothing so we don't see the tooltips
$(this).attr("title","");
@spigotdesign
spigotdesign / hide-zero-value.php
Last active June 26, 2018 17:17
Hide zero value on WooCommerce free shipping methods
/*
* Hide zero value on any zero cost shipping methods
*
*/
add_filter( 'woocommerce_cart_shipping_method_full_label', function( $label, $method ) {
if ( $method->cost <= 0 ) {
$label = $method->get_label();
@spigotdesign
spigotdesign / woo-checkout-change-default-state.php
Created May 8, 2018 17:05
Change default state on WooCommerce checkout state dropdown
/**
* Change the default state on the checkout page
*/
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' );
add_filter( 'default_checkout_billing_state', 'change_default_checkout_state' );
function change_default_checkout_state() {
return 'XX'; // state code
}
@spigotdesign
spigotdesign / woo-checkout-change-default-country.php
Last active May 8, 2018 17:45
Change the default country for WooCommerce checkout shipping
/**
* Change the default country on the checkout page
*/
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' );
function change_default_checkout_country() {
return 'US'; // Put Country code here
}
@spigotdesign
spigotdesign / wp-media-https.php
Last active May 7, 2018 14:59
Force WordPress Media button to insert https links
add_filter( ‘image_send_to_editor’, ‘force_protocol_relative’, 10, 9 );
function force_protocol_relative($content) {
$content = str_replace( ‘http://’, ‘https://’, $content );
return $content;
}
@spigotdesign
spigotdesign / remove-woo-product-gallery
Created May 2, 2018 19:20
Remove WooCommerce Product Gallery
@spigotdesign
spigotdesign / remove-woo-thumbnail-image-links.php
Last active November 3, 2022 09:29
Remove image links from WooCommerce thumbnail images