Skip to content

Instantly share code, notes, and snippets.

Travis Northcutt tnorthcutt

Block or report user

Report or block tnorthcutt

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
joshuadavidnelson / gravity-form-cmb2-options.php
Last active Aug 5, 2018
A function to return an array of gravity forms for a CMB2 select field.
View gravity-form-cmb2-options.php
* Get an array of gravity forms.
* @since 1.0.0
* @return void
function jdn_gf_options() {
$form_array = array();
mgratch / RCP_login_redirect.php
Created May 8, 2015
Automatically redirect users to where they came from upon logging in and out. Warning this does cause a problem when logging out from a restricted content page.
View RCP_login_redirect.php
function mg_rcp_hijack_login_url() {
global $rcp_options;
if( isset( $rcp_options['login_redirect'] ) ) {
$login_url = get_the_permalink( $rcp_options['login_redirect'] );
return $login_url;
pjrvs / newslettercookie.html
Last active Nov 7, 2017
a jquery cookie that shows a signup form for people that aren't signed up and an alternate message for people that came from the list or signed up.
View newslettercookie.html
<!DOCTYPE html>
<title>jQuery Cookie + MailChimp</title>
<meta charset="utf-8">
<form action="XXX" method="post" class="signup">



pippinsplugins / gist:11402562
Last active Oct 14, 2018
Custom user fields for Restrict Content Pro
View gist:11402562
Plugin Name: Restrict Content Pro - Custom User Fields
Description: Illustrates how to add custom user fields to the Restrict Content Pro registration form that can also be edited by the site admins
Version: 1.0
Author: Pippin Williamson
Author URI:
Contributors: mordauk
DanHerbert /
Last active Jan 19, 2020
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

READ THIS Very Important Update

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

View functions.php
function be_custom_loop() {
$loop = new WP_Query( $args );
if( $loop->have_posts() ): while( $loop->have_posts() ): $loop->the_post();
$classes = 0 == $loop->current_post || 0 == $loop->current_post % 2 ? 'one-half first' : 'one-half';
echo '<div class="' . $classes . '">' . get_the_title() . '</div>';
endwhile; endif; wp_reset_postdata();
thomasgriffin / gist:8012662
Last active Dec 31, 2015
View gist:8012662
add_action( 'add_meta_boxes', 'tgm_remove_all_the_metaboxes', 100 );
* Removes all metaboxes except the ones I WANT ON MY POST TYPE. RAGE.
* This assumes a specific post type. In my case, it is 'envira'.
* This function is very aggressive and removes every single metabox minus
* the needed submitdiv metabox (which allows you to publish something) and
* the metaboxes that I register with my plugin.
norcross / norcross-debug-functions.php
Last active Aug 6, 2019
my list of debugging functions to keep in an MU file
View norcross-debug-functions.php
Plugin Name: Norcross Debug Functions
Plugin URI:
Description: A set of functions I use on all sites while building
Author: Andrew Norcross
Version: 0.0.1
Requires at least: 3.0
Author URI:
You can’t perform that action at this time.