Skip to content

Instantly share code, notes, and snippets.


Curtis McHale curtismchale

View GitHub Profile
kstover / export-filtered-subs.php
Last active Aug 29, 2015
Exporting filtered submissions using the Ninja Forms Submissions API
View export-filtered-subs.php
// Build an array that we can use for filtering our submitted data.
$args = array(
// fields is a key in our associative array that means we're looking for field values.
'fields' => array(
// 1 represents our field id and 'Kevin' represents the value we're looking to match.
1 => 'Kevin',
// If you want to filter by multiple fields, you'd add them here.
// 2 => 'checked'
pippinsplugins / gist:d498bb26d0723ae99f0a
Created Jul 11, 2014
Disable the Stripe payment gateway when a specific Download ID is in the cart
View gist:d498bb26d0723ae99f0a
function pw_edd_maybe_disable_stripe( $gateways ) {
$disable = false;
$cart_items = edd_get_cart_contents();
if( $cart_items ) {
foreach( $cart_items as $item ) {
trepmal / comment-generate-cli.php
Created Jul 3, 2014
Can either pop this into a plugin and activate it to make the command available. Or install as a package via these instructions:
View comment-generate-cli.php
if ( !defined( 'WP_CLI' ) ) return;
* Comment Generate
class Comment_Generate extends WP_CLI_Command {
View gist:9356456
* Woo: Custom Download View
* Enable custom download box from plugin, if plugin is de-activated
* fallback to woocommerce default.
function rapid_mydownloads( $template, $slug, $name ) {
if ( $template == 'myaccount/my-downloads.php' && function_exists( 'rapid_show_custom_download_box' ) ) {
global $woocommerce;
mannieschumpert / gist:8888351
Last active Feb 22, 2021
Some filter examples for preventing editing of certain users.
View gist:8888351
* Prevent Editing of a specified user
* This example shows how you can protect the original admin from being edited or deleted by anyone else
add_filter('map_meta_cap', 'prevent_user_edit', 10, 4 );
function prevent_user_edit( $required_caps, $cap, $user_id, $args ){
$protected_user = 1; // ID of user not editable
View custom-uploader-markup.php
echo '<tr class="addon-file-field">';
echo '<th>';
echo '<label for="addon-file">'.__( 'ZIP file', '' ).'</label>';
echo '</th>';
echo '<td>';
echo '<input type="text" name="addon-meta[file]" id="addon-file" class="widefat" value="'.esc_url( $file ).'">';
echo '</td>';
echo '</tr>';
Melindrea / Gruntfile.js
Created Oct 29, 2013
PHP tasks for grunt
View Gruntfile.js
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// show elapsed time at the end
tommcfarlin / complete-mobile-media-query-boilerplate.css
Last active Jul 22, 2018
A media query boilerplate for responsive design that covers iPhones, iPhone 5s, tablets, and iPads for viewing sites and applications in both portrait and landscape mode.
View complete-mobile-media-query-boilerplate.css
* Note that the following media queries are intended to be used for the specified device or screen size
* in both portrait and landscape mode.
* Desktop queries are not provided since the default styles for most sites and applications typically focus
* on that for the default sites.
* Contributes, comments, and all that fun stuff always welcome :).
View Three Wise

Date: [date]

Between us [company name] and you [customer name].


In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

kloon /
Last active Dec 4, 2020
Github to plugin repo deploy
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here:
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
MAINFILE="camptix-payfast.php" # this should be the name of your main php file in the wordpress plugin
# git config