Skip to content

Instantly share code, notes, and snippets.

View robskidmore's full-sized avatar

Rob Skidmore robskidmore

View GitHub Profile
@robskidmore
robskidmore / hover-and-replace-data-attributes.js
Created January 23, 2014 00:52
Hover and replace using data-attributes
jQuery(function($) {
$('.hover-image').bind('mouseover', function() {
$('.testimonial').html($(this).data('testimonial'));
});
});
@robskidmore
robskidmore / print-taxonomies-by-post.php
Last active January 4, 2016 01:49
Print out current post taxonomies in an html comment
<?php
function get_current_post_taxonomies(){
global $post;
$taxonomy_names = get_object_taxonomies( $post );
?>
<!--<tt><pre><?php print_r( $taxonomy_names); ?></tt></pre>-->
<?php
}
@robskidmore
robskidmore / woocommerce-autocomplete-payment-gateway.php
Last active January 3, 2016 21:59
Autocomplete Woocommerce order based on payment gateway
<?php
// Update order status based on the id of payment gateway
function credit_card_complete_order_status( $order_id ) {
$order = new WC_Order( $order_id );
if ( $order->payment_method == 'authorize_net' ) {
$order->update_status('completed', 'Automatically Completed');
}
}