Skip to content

Instantly share code, notes, and snippets.

@ethitter
ethitter / wpcom-vip-multisite-subdirectory-rewrites.php
Created July 23, 2016 01:19
WordPress.com VIP site in a subdirectory
<?php
/**
* Move entire multisite into a subdirectory within its assigned domain
*/
class WPCOM_VIP_Multisite_Subdirectory_Rewrites {
/**
* Singleton
*/
private static $__instance = null;
@ethitter
ethitter / keybase.md
Last active August 19, 2023 00:36
keybase.md

Keybase proof

I hereby claim:

  • I am ethitter on github.
  • I am ethitter (https://keybase.io/ethitter) on keybase.
  • I have a public key ASDCoI1IjGoidsf5HlGtJQ3B8o52LJFU1aLxcXj632OceQo

To claim this, I am signing this object:

@ethitter
ethitter / sharedaddy-shortcode.php
Created May 18, 2015 23:59
Dysfunctional Sharedaddy shortcode
<?php
/**
*
*/
class Jetpack_Sharing_Shortcode {
/**
* Singleton!
*/
private static $__instance = null;
@ethitter
ethitter / nginx-permalinks.php
Last active August 29, 2015 14:05
WordPress permalink overrides for nginx
@ethitter
ethitter / disable-photon.php
Last active July 18, 2017 00:36
Disable Jetpack's Photon module for certain calls to WordPress image functions
<?php
// See https://ethitter.com/p/897/
$photon_removed = remove_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ) );
// Call wp_get_attachment_image(), wp_get_attachment_image_src(), or anything else that ultimately calls image_downsize()
if ( $photon_removed ) {
add_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ), 10, 3 );
}
@ethitter
ethitter / gist:5136596
Created March 11, 2013 18:49
Piwik for Multisite
<?php
/*
Plugin name: Piwik Stats
Description: Implement Piwik tracking code
Version: 1.0
Author: Erick Hitter
Author URI: http://www.ethitter.com
License: GPLv2
*/
@ethitter
ethitter / gist:4430520
Last active May 31, 2017 16:14
WordPress MU Domain Mapping and the Customizer
Index: domain_mapping.php
===================================================================
--- domain_mapping.php (revision 688919)
+++ domain_mapping.php (working copy)
@@ -685,7 +685,7 @@
}
function redirect_to_mapped_domain() {
- global $current_blog, $wpdb;
+ global $current_blog, $wpdb, $wp_customize;