Skip to content

Instantly share code, notes, and snippets.

View curtismchale's full-sized avatar

Curtis McHale curtismchale

View GitHub Profile
<?php
/*
Plugin Name: Log wp_mail()
Version: 0.1
Plugin URI: http://wsu.edu
Description: Log emails sent through WordPress to a text file.
Author: jeremyfelt, wsu.edu
*/
add_filter( 'wp_mail', 'wsu_log_wp_mail', 1 );

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.

@johnpbloch
johnpbloch / gist:6029614
Created July 18, 2013 14:07
Remove a filter (or action) without a reference to an object
<?php
function remove_filter_by_classname( $filter, $classname, $priority ) {
global $wp_filter;
$match = false;
if( !empty( $wp_filter[$filter] ) && !empty( $wp_filter[$filter][$priority] ) ) {
foreach( $wp_filter[$filter][$priority] as $added_filter ) {
if( is_array( $added_filter['function'] ) && get_class( $added_filter['function'][0] ) === $classname ) {
$match = $added_filter;
break;