Skip to content

Instantly share code, notes, and snippets.

View codiller's full-sized avatar

Cody Martens codiller

View GitHub Profile
@codiller
codiller / CMB2 text_money issue
Created July 8, 2015 23:53
2 Text_Money fields in a custom field type not working
<?php
add_filter( 'cmb2_render_rental_fees', 'cmb2_render_rental_fees_callback', 10, 5 );
function cmb2_render_rental_fees_callback( $field, $value, $object_id, $object_type, $field_type_object ) {
$prefix = '_tlc_';
$value = wp_parse_args( $value, array(
'rental-rent' => '',
'rental-deposit' => '',
<?php
/*
*
* Save email in a cookie for ActiveCampaign
*
*/
add_filter( 'gform_save_field_value', 'tlc_save_field_value', 10, 4);
function tlc_save_field_value( $value, $lead, $field, $form ) {
if ($field['label'] == 'Your Email') { // MAKE SURE THIS MATCHES THE NAME OF YOUR FIELD LABEL IN YOUR FORM
<?php
/*
*
* Website tracking for ActiveCampaign
*
*/
add_filter('wp_head', 'tlc_ac_tracking_email');
function tlc_ac_tracking_email() {
<?php
/*
*
* Creates a Gravity Forms custom field type for UTM parameters and URL info
*
*/
if ( ! class_exists( 'GFForms' ) ) {
return;
jQuery(document).ready(function($){
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var source = getParameterByName('utm_source');
var medium = getParameterByName('utm_medium');
@codiller
codiller / enqueue-js-cookie.php
Created April 2, 2019 00:57
Enqueue JS Cookie in Functions.php
<?php
/*
*
* Checks to see if Gravity Forms exists
*
*/
if( class_exists( 'GFForms' ) ) {
/*