Skip to content

Instantly share code, notes, and snippets.

View zanetaylor's full-sized avatar
👽

Zane Taylor zanetaylor

👽
View GitHub Profile
@mannieschumpert
mannieschumpert / gist:8334811
Last active August 20, 2023 14:58
Filter the submit button in Gravity Forms to change the <input type="submit> element to a <button> element. There's an example in the Gravity Forms documentation, but it lacks the proper code to show your custom button text, AND removes important attributes like the onclick that prevents multiple clicks. I was trying to solve that.
<?php
// filter the Gravity Forms button type
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>";
// This includes your custom button text:
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>";
}
// Oops this strips important stuff
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@hagronnestad
hagronnestad / WordPress: Wrap images in DIV.php
Last active September 27, 2021 19:09
WordPress: Wrap images in DIV.
// =======================
// = WRAP IMAGES IN DIVS =
// =======================
function wrapImagesInDiv($content) {
$pattern = '/(<img[^>]*class=\"([^>]*?)\"[^>]*>)/i';
$replacement = '<div class="image-container $2">$1</div>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
@jarcoal
jarcoal / modal.less
Created October 22, 2012 21:43
Static Modal
body.modal-open {
overflow: hidden;
}
.modal-backdrop {
.hide;
background-color: rgba(255, 255, 255, 0.8);
.opacity(100);
overflow-x: auto;
@loonies
loonies / .htaccess
Last active August 28, 2018 05:45
Kohana .htaccess
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
@danott
danott / modernizr-tests.js
Created March 4, 2011 16:55
Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/