Skip to content

Instantly share code, notes, and snippets.

View cipriantepes's full-sized avatar
🏠
Working from home

Ciprian Tepes cipriantepes

🏠
Working from home
View GitHub Profile
@cipriantepes
cipriantepes / gf-enter-prevent-submission.php
Created May 22, 2019 08:14 — forked from uamv/gf-enter-prevent-submission.php
Disables form submission when pressing Enter, unless user has tabbed to submit button or page advance button.
<?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;
@cipriantepes
cipriantepes / gist:e35e4378449a6c59d7a8500c5b1da858
Created March 22, 2017 18:42 — forked from mohammadmursaleen/gist:9622098e43afdab6025e
Adding custom fields above WOOCOMMERCE add to cart button
<?php
// To add custom data above add to cart button in woocommerce
// step 1
add_action('wp_ajax_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback');
add_action('wp_ajax_nopriv_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback');
function wdm_add_user_custom_data_options_callback()
@cipriantepes
cipriantepes / custom-logo.php
Last active September 5, 2016 20:04 — forked from neilgee/custom-logo.php
Using Custom Logo with Genesis via Customizer
<?php
add_theme_support( 'custom-logo', array(
'height' => 240, // set to your dimensions
'width' => 240,
'flex-height' => true,
'flex-width' => true,
) );