Skip to content

Instantly share code, notes, and snippets.

View kshaner's full-sized avatar

Kurtis Shaner kshaner

  • Seattle, WA
  • 19:43 (UTC -07:00)
View GitHub Profile
@kshaner
kshaner / gist:8965524
Created February 12, 2014 22:07
Remove W3 Total Cache comment from footer except for admins
// Disable W3TC footer comment for everyone but Admins (single site) / Super Admins (network mode)
if ( !current_user_can( 'unfiltered_html' ) ) {
add_filter( 'w3tc_can_print_comment', function( $w3tc_setting ) { return false; }, 10, 1 );
}
@kshaner
kshaner / Require a wordpress taxonomy to be selected
Created May 16, 2014 12:54
Require a wordpress taxonomy to be selected
/*
* Enqueue this function anywhere in the wordpress admin to require a category selection on the array of post types
*/
$(function() {
var post = document.getElementById('post'),
post_types = ['post'],
post_type = false,
errormsg = function(str) {
msgdiv = document.getElementById('message');
if (msgdiv) {
@kshaner
kshaner / keybase.md
Created June 18, 2015 14:10
Keybase

Keybase proof

I hereby claim:

  • I am kshaner on github.
  • I am kshaner (https://keybase.io/kshaner) on keybase.
  • I have a public key whose fingerprint is FE1C A39F C428 21AD EE1E 2B7C DC63 AEA3 49E5 6AAB

To claim this, I am signing this object:

@kshaner
kshaner / gulpfile.js
Last active May 12, 2020 11:35
Gulp copy from NPM for front end scripts
const pkg = require('./package.json');
const gulp = require('gulp');
const nodePath = require('path');
// project
const project = {};
project.node = 'node_modules';
project.dist = nodePath.posix.normalize(`${project.assets}/dist`);
project.vendor = nodePath.posix.normalize(`${project.assets}/vendor`);
@kshaner
kshaner / popup-builder-patch.php
Last active November 8, 2019 19:40
Patch popup builder's class path loading on multi head environments
<?php
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {
/**
* filter popup-builders path for multi head environments
*
* @param mixed $value
* @param string $option
* @param int $network_id
* @return mixed