Skip to content

Instantly share code, notes, and snippets.

View sirchrispy's full-sized avatar
🤔
Just doing my thing.

Chris Power sirchrispy

🤔
Just doing my thing.
View GitHub Profile
@sirchrispy
sirchrispy / wpcli-flywheel-cache-flush.php
Last active April 19, 2021 20:30 — forked from jtsternberg/wpcli-flywheel-cache-flush.php
Flush cache on Flywheel Local VM
<?php
/*
Plugin Name: Flywheel Flush Cache
Description: Flushes Local by Flywheel's cache, solving the problem of plugins showing multiple times. Drop this file in the mu-plugins folder
Version: 1.0.0
Author: jtsternberg
Author URI: https://gist.github.com/jtsternberg/03219ce49c882f20d862724e0e594c73
Text Domain: lbfw
Domain Path: /languages
@sirchrispy
sirchrispy / gist:46078436df5918070736935a88741c51
Created February 22, 2018 21:56 — 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']);
@sirchrispy
sirchrispy / functions.php
Last active December 30, 2015 09:29 — forked from wpscholar/functions.php
WP: Conditional IE stylesheets from child theme
<?php
add_action( 'wp_enqueue_scripts', 'child_theme_scripts' );
function child_theme_scripts() {
global $wp_styles;
/**
* Load our IE-only stylesheet for all versions of IE:
* <!--[if IE]> ... <![endif]-->