Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Joshua Vandercar uamv

🏠
Working from home
View GitHub Profile
@uamv
uamv / gf-enter-prevent-submission.php
Last active May 22, 2019
Disables form submission when pressing Enter, unless user has tabbed to submit button or page advance button.
View gf-enter-prevent-submission.php
<?php
function twxyz_prevent_gform_submission( $form ) { ?>
<script type="text/javascript">
jQuery(document).bind('gform_post_render', function(){
jQuery(document).on( 'keypress', '.gform_wrapper', function (e) {
var code = e.keyCode || e.which;
if ( code == 13 && ! jQuery( e.target ).is( 'textarea,input[type="submit"],input[type="button"]' ) ) {
e.preventDefault();
return false;
@uamv
uamv / ticktick-kanban-styling.css
Created Jun 17, 2020
Style TickTick Kanban Boards
View ticktick-kanban-styling.css
.column-list-view .column-list .column-list-content {
flex-direction: column;
flex-wrap: wrap;
max-height: calc( 100vh - 72px );
width: fit-content;
}
.column-list-view .column {
margin: 0 1.5em 2em 6px;
height: fit-content;
@uamv
uamv / gf-map-class-to-post-meta.php
Last active Jun 26, 2020
Save Gravity Form field data to post meta by adding a class to the field.
View gf-map-class-to-post-meta.php
<?php
/**
* Save Gravity Form field data to post meta by adding a class to any field.
* Meta is mapped so that it is readable by Advanced Custom Fields
* Format class as…
* post_meta-{meta_key} -- for simple fields & writing lists as array to single meta record
* post_meta-{meta_key}-.3 -- for multi-input fields
* post_meta-{repeater_key}-1.{meta_key} -- for list fields mapped to meta readable by ACF
*/
// Run this function after the Gravity Form has created a post
You can’t perform that action at this time.