Skip to content

Instantly share code, notes, and snippets.

View njeffers's full-sized avatar
🤖

Nick Jeffers njeffers

🤖
View GitHub Profile
@njeffers
njeffers / gist:b677f7327269f69c6fe064804d13f0fa
Last active January 7, 2020 05:39
Force Woocommerce to Collect Payment Info on All Orders
/**
* Force Woocommerce to require payment on all orders
*
* @author Nick Jeffers
* @url nickjeffers.com
*/
add_filter( 'woocommerce_cart_needs_payment', '__return_true', 10, 2 );
@njeffers
njeffers / gist:bccdac0c4864f3043afd7e286b4d64b9
Last active January 20, 2020 20:55
Gravity Forms Splices
/**
* This is a helper function to grab existing forms and splice them into another form - kinda like form templates
*
* @param int $template_form_id - the ID of the form you want to copy over
* @param int $destination_form_id - ID of the form you want to copy it to
* @param int $num_fields_to_skip - how many fields to skip before splicing the form in. Note: this is a count,
* NOT 0 index. 2 = 2 fields.
*
* @author Nick Jeffers
* @url nickjeffers.com
@njeffers
njeffers / gist:1ab321ff6761d70b90a649d6b1095e4a
Last active November 26, 2019 19:13
Installing PDFtk, ImageMagik, and PDFJam on Ubuntu 18.04
##Pre 18.04 versions:
sudo apt-get install pdftk
--------------------------
##Ubuntu 18.04 - #credit to abu_bua - see https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-and-later
cd /tmp
wget http://launchpadlibrarian.net/340410966/libgcj17_6.4.0-8ubuntu1_amd64.deb \
<?php
/**
* Override the output of the submit button on forms, useful for
* adding custom classes or other attributes.
*
* @param string $button An HTML string of the default button
* @param array $form An array of form data
* @return string $button
*
* @filter gform_submit_button
@njeffers
njeffers / wp-query-ref.php
Created January 1, 2016 02:23 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(