Skip to content

Instantly share code, notes, and snippets.

View blogjunkie's full-sized avatar

David Wang blogjunkie

View GitHub Profile
@blogjunkie
blogjunkie / taxonomies.php
Created February 26, 2013 02:25
Register custom taxonomies 1) quote topic and 2) quote author for quote custom post type
<?php
/**
* Taxonomies
*
* This file registers any custom taxonomies
*
* @package Core_Functionality
* @since 1.0.0
* @link https://github.com/billerickson/Core-Functionality
* @author Bill Erickson <[email protected]>
@blogjunkie
blogjunkie / gist:4712311
Last active April 2, 2016 05:57
Display a custom message for WooCommerce subscription products in order complete email. Goes in your theme's functions.php or as a plugin. Credits: Patrick Garman (@pmgarman)
<?php
/* Custom message for subscription products in order complete email */
add_action( 'woocommerce_email_after_order_table', 'wc_completed_email_snippet' );
function wc_completed_email_snippet( $order ) {
$order_statuses = array( 'completed' ); // order statuses to enable the email on
$display_cats = array( 148, 149 ); // cat ID's of products to display the message on completed emails for
if( in_array( $order->status, $order_statuses ) )
return; // only completed orders
if( !class_exists( 'WC_Subscriptions_Order' ) || !class_exists( 'WC_Subscriptions_Renewal_Order' ) )