Skip to content

Instantly share code, notes, and snippets.

View beesmart's full-sized avatar

Stephen beesmart

View GitHub Profile
@mikejolley
mikejolley / gist:2282666
Last active January 15, 2018 19:58
WooCommerce - Don't allow PO BOX within postcode, address 1 or address 2 fields.
add_action('woocommerce_after_checkout_validation', 'deny_pobox_postcode');
function deny_pobox_postcode( $posted ) {
global $woocommerce;
// Put postcode, address 1 and address 2 into an array
$check_address = array();
$check_address[] = isset( $posted['shipping_postcode'] ) ? $posted['shipping_postcode'] : $posted['billing_postcode'];
$check_address[] = isset( $posted['shipping_address_1'] ) ? $posted['shipping_address_1'] : $posted['billing_address_1'];
$check_address[] = isset( $posted['shipping_address_2'] ) ? $posted['shipping_address_2'] : $posted['billing_address_2'];
@jakebresnehan
jakebresnehan / Simple-HTML5-Local-Storage.js
Created March 6, 2012 06:02
Simple HTML5 Local Storage example to hide a element
Need to include Modernizer (http://www.modernizr.com/) and jQuery (http://jquery.com/)
$(document).ready(function($){
if (Modernizr.localstorage) {
$('#hide-button').click(function(e){
localStorage.setItem('subscribed',true);
$('#sign-up-form,#hide-button').hide();
$('#hide-button').hide();