Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth gbissland

  • Weave Digital Studio
  • New Zealand
View GitHub Profile
@gbissland
gbissland / gist:2bd3df9aafd2cadaee07f1a86e3f2c88
Created May 4, 2017 03:21 — forked from getdave/gist:4578295
Gravity Forms - custom field validation function for checkboxes. Ensures all checkboxes have been checked.
// Replace 7 with the ID of your form and 13 with the ID of the field you want to force "all required"
// http://www.gravityhelp.com/documentation/page/Gform_field_validation
add_filter("gform_field_validation_7_13", 'validate_tcs', 10, 4);
function validate_tcs($result, $value, $form, $field) {
// Convert the checkbox input name value (returned as part of "field")
// into the "underscored" ID version which is found in the $_POST
foreach ($field['inputs'] as $input) {
$input_post_value = 'input_' . str_replace('.', '_', $input['id']);
<?php
add_action( 'init', 'prefix_disable_post_page_analysis' );
/**
* Conditionally disable the Yoast Page Analysis on post and page admin edit screens.
*
* @uses prefix_is_edit_screen
* @return NULL if we're not on the right admin screen
* @author Robert Neu <http://wpbacon.com>
* @link http://auditwp.com/wordpress-seo-admin-columns/

Keybase proof

I hereby claim:

  • I am gbissland on github.
  • I am tacoloco (https://keybase.io/tacoloco) on keybase.
  • I have a public key whose fingerprint is 913D A71A C780 76E7 AF8F 90A4 8351 DC6D 7D7F B42A

To claim this, I am signing this object:

find . -name \.AppleDouble -exec rm -rf {} \;
@gbissland
gbissland / 0_reuse_code.js
Created December 3, 2013 21:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console