Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Joshua Vandercar uamv

🏠
Working from home
Block or report user

Report or block uamv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@uamv
uamv / gf-custom-merge-tags.php
Last active Apr 23, 2019
Add custom merge tags to Gravity Forms
View gf-custom-merge-tags.php
<?php
add_filter( 'gform_replace_merge_tags', 'typewheel_custom_merge_tags', 10, 7 );
function typewheel_custom_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
$custom_merge_tags = array(
'{date_ymd}' => date( 'Y.m-M.d', strtotime( $entry['date_created'] ) ),
'{timestamp}' => time(),
'{site_url}' => get_site_url(),
'{site_name}' => get_bloginfo( 'name' )
@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;
You can’t perform that action at this time.