Skip to content

Instantly share code, notes, and snippets.

@troydean
troydean / 0_reuse_code.js
Created February 16, 2014 06:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@troydean
troydean / lgbk_add_member.php
Created March 3, 2014 10:51
WooCommerce Change User Role on Purchase of Specific Product
function lgbk_add_member( $order_id ) {
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
$product_name = $item['name'];
$product_id = $item['product_id'];
$product_variation_id = $item['variation_id'];
}