This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Putting Locations in Checkboxes */ | |
/* Helpful article - https://www.gravityhelp.com/documentation/article/dynamically-populating-drop-down-fields/ */ | |
/*-----------------------------------------------------------------------------------*/ | |
$location_form_id = 9; | |
add_filter( 'gform_pre_render_'.$location_form_id, 'populate_posts' ); | |
add_filter( 'gform_pre_validation_'.$location_form_id, 'populate_posts' ); | |
add_filter( 'gform_pre_submission_'.$location_form_id, 'populate_posts' ); | |
add_filter( 'gform_pre_submission_filter_'.$location_form_id, 'populate_posts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.parent{ | |
display:flex; | |
flex-wrap:wrap; | |
margin: -10px 0 0 -10px; | |
} | |
.child{ | |
display:inline-block; | |
margin: 10px 0 0 10px; | |
flex-grow:1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- source: http://jsfiddle.net/kizu/4RPFa/4570/ --> | |
<!-- my test: https://jsfiddle.net/leepettijohn/fdor13vd/ --> | |
<style> | |
.frame { | |
height: 100px; /* equals max image height */ | |
width: 160px; | |
border: 1px solid red; | |
white-space: nowrap; | |
text-align: center; margin: 1em 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
//source: https://www.gravityhelp.com/documentation/article/gform_pre_send_email/#4-copy-to-to-bcc | |
add_filter( 'gform_pre_send_email', function ( $email, $message_format, $notification ) { | |
if ( $notification['name'] != 'User Email' ) { | |
return $email; | |
} | |
$email['headers']['Bcc'] = 'Bcc: ' . $email['to']; | |
$email['to'] = '[email protected]'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* link - http://wordpress.stackexchange.com/questions/210060/get-selected-values-from-checkboxes-and-radio-buttons-via-gravity-forms-gform-af*/ | |
$field_id = 4; | |
$field = GFFormsModel::get_field( $form, $field_id ); | |
$field_selections = is_object( $field ) ? $field->get_value_export( $entry ) : ''; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Change form ID */ | |
$location_form_id = 9; | |
add_filter( 'gform_pre_render_'.$location_form_id, 'populate_list' ); | |
add_filter( 'gform_pre_validation_'.$location_form_id, 'populate_list' ); | |
add_filter( 'gform_pre_submission_'.$location_form_id, 'populate_list' ); | |
add_filter( 'gform_admin_pre_render_'.$location_form_id, 'populate_list' ); | |
function populate_list( $form ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Going from Gravity Form list to ACF Repeater functionality */ | |
add_action( 'gform_after_submission_9', 'list_to_repeater', 1, 2 ); | |
function list_to_repeater( $entry, $form ) { | |
/* Set the field ids for the custom list fields */ | |
$list_key = 'field_585ae03ad9aab'; | |
/* get and unserialize the list */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* *** Change form id on next line *** */ | |
add_action( 'gform_after_submission_10', 'update_wdi_approved', 10, 2 ); | |
function update_wdi_approved( $entry, $form ) { | |
/* *** Get the field result *** */ | |
$get_title = rgar($entry,'1'); | |
$get_wdi_date = rgar($entry,'2'); | |
/* *** Get the custom post type 'clip_order' id *** */ | |
$orderid = get_page_by_title($get_title,'OBJECT','clip_order'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Putting Locations in a Dropdown, Radio Button, or Multi-Select */ | |
/* Helpful article - https://www.gravityhelp.com/documentation/article/dynamically-populating-drop-down-fields/ */ | |
/*-----------------------------------------------------------------------------------*/ | |
$location_form_id = 9; | |
add_filter( 'gform_pre_render_'.$location_form_id, 'populate_posts' ); | |
add_filter( 'gform_pre_validation_'.$location_form_id, 'populate_posts' ); | |
add_filter( 'gform_pre_submission_'.$location_form_id, 'populate_posts' ); | |
add_filter( 'gform_pre_submission_filter_'.$location_form_id, 'populate_posts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("div[class*='fa-']").each(function(){ | |
var check = "fa-"; | |
// Get array of class names | |
var cls = $(this).attr('class').split(' '); | |
for (var i = 0; i < cls.length; i++) { | |
// Iterate over the class and log it if it matches | |
if (cls[i].indexOf(check) > -1) { | |
console.log(cls[i].slice(check.length, cls[i].length)); | |
return cls[i].slice(check.length, cls[i].length); | |
} |