Skip to content

Instantly share code, notes, and snippets.

View warunanc's full-sized avatar

warunanc

View GitHub Profile
@t-mat
t-mat / rapidxml-example.cpp
Last active August 11, 2022 19:12
RapidXML : Simple traverse all nodes/attributes
// RapidXml : http://rapidxml.sourceforge.net/
#include <cstddef>
#include <cassert>
#define RAPIDXML_NO_STDLIB
#define RAPIDXML_NO_EXCEPTIONS
#include "rapidxml-1.13/rapidxml.hpp"
#include <stdio.h>
#include <string>
#include <vector>
@kloon
kloon / gist:4541017
Last active January 26, 2024 18:14
WooCommerce Clear Cart via URL
// check for clear-cart get param to clear the cart, append ?clear-cart to any site url to trigger this
add_action( 'init', 'woocommerce_clear_cart_url' );
function woocommerce_clear_cart_url() {
if ( isset( $_GET['clear-cart'] ) ) {
global $woocommerce;
$woocommerce->cart->empty_cart();
}
}