Skip to content

Instantly share code, notes, and snippets.

Tom Willmot willmot

Block or report user

Report or block willmot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@willmot
willmot / termmeta.php
Last active May 6, 2016
Add termmeta support to WordPress including a termmeta table and all the standard WordPress metadata functions
View termmeta.php
<?php
/**
* Setup the termmeta table
*
* Use <code>add_theme_support( 'term-meta' );</code> to enable support for term meta
*/
function hm_add_term_meta_table() {
global $wpdb;
@willmot
willmot / disable-updates.php
Created May 29, 2012
Disable core, theme and plugin update checks and notices and remove the update page from nav
View disable-updates.php
<?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 / .gitignore
Created May 29, 2012
Yell .gitignore file
View .gitignore
/.htaccess
/wp-config.php
/wp-content/uploads/
@willmot
willmot / php.rb
Created Mar 20, 2012 — forked from pgib/php.rb
PHP 5.2.4 Formula for Homebrew
View php.rb
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
class Php < Formula
url 'http://museum.php.net/php5/php-5.2.4.tar.gz'
homepage ''
md5 '0826e231c3148b29fd039d7a8c893ad3'
@willmot
willmot / plugin-activate.php
Created Jan 29, 2012
Require a minimum PHP version on plugin activation
View plugin-activate.php
<?php
// Don't activate on anything less than PHP 5.2.4
if ( version_compare( phpversion(), '5.2.4', '<' ) ) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
deactivate_plugins( WPRP_PLUGIN_SLUG . '/plugin.php' );
if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) )
die( __( 'WP Remote requires PHP version 5.2.4 or greater.', 'wpremote' ) );
@willmot
willmot / category-sticky-posts.php
Created Dec 1, 2011
Show sticky posts on category archive pages
View category-sticky-posts.php
/**
* 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
@willmot
willmot / gist:1277790
Created Oct 11, 2011
WordPress attachment category plugin
View gist:1277790
<?php
/*
Plugin Name: Attachment Categories
Description: Allows attachments to be categorised
Version: 1.0
Author: Human Made Limited
Author URI: http://hmn.md
*/
You can’t perform that action at this time.