Skip to content

Instantly share code, notes, and snippets.

View willmot's full-sized avatar

Tom Willmot willmot

View GitHub Profile
@willmot
willmot / gist:1277790
Created October 11, 2011 10:33
WordPress attachment category plugin
<?php
/*
Plugin Name: Attachment Categories
Description: Allows attachments to be categorised
Version: 1.0
Author: Human Made Limited
Author URI: http://hmn.md
*/
@willmot
willmot / functions.php
Created April 12, 2013 10:11
Run all images in the_content through WP Thumb
<?php
/**
* Run images inserted into posts through WP Thumb
*
* This serves a couple of purposes, 1 it allows us to delete the cache folder
* without having to worry about losing images and 2 it ensures all images
* are cropped to the correct size and limited to $content_width
*
* @var string

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

<?php
/*
Plugin Name: Gravity Forms Encryptorator
Plugin URI: https://github.com/humanmade/Gravity-Forms-Encryptorator
Description: Encrypt all Gravity Forms data on the way into the database using openssl public encryption, data can only be decrypted with the associated private key.
Author: Human Made Limited
Version: 1.0 Alpha
Author URI: http://www.hmn.md/
*/
@willmot
willmot / wordpress.vcl
Created July 4, 2012 15:48
WordPress Varnish VCL
backend default {
.host = "127.0.0.1";
.port = "8444";
}
sub vcl_recv {
# Allow the back-end to serve up stale content if it is responding slowly.
set req.grace = 2m;
@willmot
willmot / disable-updates.php
Created May 29, 2012 21:08
Disable core, theme and plugin update checks and notices and remove the update page from nav
<?php
// Don't disable on dev
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
// Disable core update checking
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
remove_action( 'admin_init', '_maybe_update_core' );
remove_action( 'wp_version_check', 'wp_version_check' );
@willmot
willmot / category-sticky-posts.php
Created December 1, 2011 16:29
Show sticky posts on category archive pages
/**
* Adds sticky posts to your category archive
* pages.
*
* Works in exactly the same way as sticky posts work
* on the homepage, including all the negatives like
* breaking the posts_per_page and only showing
* them on page 1 etc.
*
* @param array $posts