Skip to content

Instantly share code, notes, and snippets.

Avatar

Kurtis Shaner kshaner

View GitHub Profile
@kshaner
kshaner / popup-builder-patch.php
Last active Nov 8, 2019
Patch popup builder's class path loading on multi head environments
View popup-builder-patch.php
<?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
@kshaner
kshaner / gulpfile.js
Last active May 12, 2020
Gulp copy from NPM for front end scripts
View gulpfile.js
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`);
View keybase.md

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 / Require a wordpress taxonomy to be selected
Created May 16, 2014
Require a wordpress taxonomy to be selected
View 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 / gist:8965524
Created Feb 12, 2014
Remove W3 Total Cache comment from footer except for admins
View gist:8965524
// 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 );
}
You can’t perform that action at this time.