Skip to content

Instantly share code, notes, and snippets.

View geekontheroad's full-sized avatar

geekontheroad

View GitHub Profile
@claygriffiths
claygriffiths / gf-get-field-by-label.php
Created December 16, 2021 17:28
Gravity Forms: Get Field by Label
<?php
/**
* Get Gravity Forms Field by Label
* @link https://gravitywiz.com
*
* @param array|int $form_or_id The Form Object or ID.
* @param string $search The field label to search by.
* @param string $label_property The property from the field to search using. Defaults to "label". Set to "adminLabel"
* to search by the admin label.
*
@bagerathan
bagerathan / woo-events.js
Last active October 28, 2024 06:19
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@uamv
uamv / gf-custom-merge-tags.php
Last active May 26, 2022 01:12
Add custom merge tags to Gravity Forms
<?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' )