Skip to content

Instantly share code, notes, and snippets.

View curtismchale's full-sized avatar

Curtis McHale curtismchale

View GitHub Profile

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@curtismchale
curtismchale / woocommerce-stars.less
Created July 10, 2013 23:33
LESS for giving us star ratings in WooCommerce.
/* === star ratings === */
.woocommerce, .woocommerce-page{
.star-rating{
float: right;
overflow: hidden;
position: relative;
height: 1em;
line-height: 1em;
font-size: 1em;
@curtismchale
curtismchale / comment_form.php
Last active June 20, 2016 22:19
Adds required inside labels
/**
* Changes the default WordPress comment form fields to match the way I like them, with the required * inside
* the label.
*
* @param array $fields req The default fields for WordPress comment forms
* @return array The fields the way we want them to look
*
* @uses wp_get_current_user
* @uses get_option
*
@curtismchale
curtismchale / remove-images.php
Created February 10, 2012 20:38
remove images from content
function sfn_remove_the_images( $content = null ){
global $post;
if( $post->post_type == 'post' && !empty( $post->post_content ) ){
$content = $post->post_content;
$content = preg_replace('/<img[^>]+./','', $content);
}
@curtismchale
curtismchale / remove-poll-daddy.php
Created February 10, 2012 20:37
remove polldaddy from content
/**
* Removing the poll from the main content since
* we push it in to the sidebar
*
* @since 1.0
*/
function sfn_remove_poll_daddy( $content = null ){
global $post;
$content = $post->post_content;
@curtismchale
curtismchale / comienzo-js.php
Created December 20, 2011 05:16
Current JS file for my WordPress Development Theme
<?php
/**
* Adds scripts to the front end of the site
*
* Most scripts are only needed on the front end of the site
* and the function below makes sure jQuery is ready then adds
* the scripts we need for the site
*
* @uses wp_enqueue_script
@curtismchale
curtismchale / tinymce-custom-classes.php
Created November 30, 2011 03:23
Adds buttons/wrappers to tinymce for WordPress
<?php
// adds our custom style buttons
/**
* Filter TinyMCE Buttons
*
* Here we are filtering the TinyMCE buttons and adding a button
* to it. In this case, we are looking to add a style select
* box (button) which is referenced as "styleselect". In this
@curtismchale
curtismchale / redirect-user-role.php
Created November 2, 2011 22:32
redirect on user role
// Redirect admins to the dashboard and other users elsewhere
add_filter( 'login_redirect', 'sfn_tan_login_redirect', 10, 3 );
function sfn_tan_login_redirect( $redirect_to, $request, $user ) {
// Is there a user?
if ( is_array( $user->roles ) ) {
// Is it an administrator?
if ( in_array( 'athlete', $user->roles ) )
return home_url( '/dashboard/' );
else
@curtismchale
curtismchale / paypal-ipn-publish.php
Created October 18, 2011 18:12
supposed to catch the PayPal IPN response and publish posts
add_action( 'gform_paypal_post_ipn', 'tan_deal_with_posts', 10, 8 );
function tan_deal_with_posts( $ipn_post, $entry, $config, $cancel ){
global $current_user;
$time_period = $entry['1.1'];
$userid = $entry['created_by'];
if( empty( $userid ) ) $userid = $current_user->ID;
@curtismchale
curtismchale / ipn-response
Created October 12, 2011 16:44
paypal IPN output
Array
(
[headers] => Array
(
[date] => Wed, 12 Oct 2011 16:43:03 GMT
[server] => Apache
[x-frame-options] => SAMEORIGIN
[set-cookie] => Array
(
[0] => cwrClyrK4LoCV1fydGbAxiNL6iG=nCjyLd7d9MfRHl7YkCVHge47b1p2aZUcZJqm1l1pWkIOrNBCDtI3mJdoGwduc0EGILEnqCTT5zWFZ8QEPHgj_6hLrbjGH8B22_UCH3YkQvhladuusBIOPX-o_dCG-6gfEXsdpW%7cTMrchYr4J_kFS4bGx1rn1P3FESW--5D9CO1P9O6AUlgyt_42EAN2ZVKosoS5LWfgGI1NXG%7ckyTIO3wmjAAEyG2e7Uds0yBvJDS3ALVbWf1lUfNbhkQX4MUu8thJXciIguLaC1ALUK5IyW%7c1318437784; domain=.paypal.com; path=/; Secure; HttpOnly