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
[\(]?\d{3}[\)]?[\-]?\d{3}[\-]?\d{4} |
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
//Open Duped to Edit | |
add_action( 'gform_after_duplicate_form', 'open_new_form', 10, 2 ); | |
function open_new_form($form_id, $new_id){ | |
$url = $_SERVER['SERVER_NAME'] . "/wp-admin/admin.php?page=gf_edit_forms&id=" . $new_id; | |
echo "<script>window.location = 'http://$url&duped=true'</script>"; | |
} |
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
//Show Notification of Duped | |
add_action("gform_editor_js", 'notify_of_dupe'); | |
function notify_of_dupe(){ | |
if($_GET['duped'] === 'true'): ?> | |
<script> | |
(function($){ | |
var notification = '<div style="border-left-color:#46b450" class="updated_base gform_editor_status" id="after_update_dialog">' + | |
'<strong>Form duplicated successfully.</strong>' + |
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 | |
//Open Duped to Edit | |
add_action( 'gform_after_duplicate_form', 'open_new_form', 10, 2 ); | |
function open_new_form($form_id, $new_id){ | |
$url = $_SERVER['SERVER_NAME'] . "/wp-admin/admin.php?page=gf_edit_forms&id=" . $new_id; | |
echo "<script>window.location = 'http://$url&duped=true'</script>"; | |
} |
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 | |
/* | |
* Recruiting Specific Field Buttons | |
* | |
* @author - Daniel Kelly | |
* @date - August 15, 2016 | |
* @notes- | |
* https://www.gravityhelp.com/documentation/article/gform_add_field_buttons/ | |
* button will not display until action "gform_editor_js_set_default_values" is set |
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
/** | |
* Make a Call to the Call Metrics API | |
* | |
* @author Daniel Kelly | |
* @return void | |
*/ | |
private function makeAPICall(){ | |
header('Access-Control-Allow-Origin: *'); | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( |
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
let friendly_timezone; | |
if( tz_timezone === 'America/New_York' ){ | |
friendly_timezone = 'Eastern'; | |
}else if( tz_timezone === 'America/Chicago'){ | |
friendly_timezone = 'Central'; | |
}else if( tz_timezone === 'America/Denver'){ | |
friendly_timezone = 'Mountain'; | |
}else if( tz_timezone === 'America/Los_Angeles'){ | |
friendly_timezone = 'Pacific'; | |
}else{ |
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
let friendly_timezone; | |
switch( tz_timezone ) { | |
case 'America/New_York': | |
friendly_timezone = 'Eastern'; | |
break; | |
case 'America/Chicago': | |
friendly_timezone = 'Central'; | |
break; | |
case 'America/Denver': | |
friendly_timezone = 'Mountain'; |
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
//In helper file with global helper functions | |
function switchMap(before_value, map={}, default_value=false){ | |
return Object.keys(map).includes(before_value) ? map[before_value] : default_value; | |
} | |
//In code where condition is needed | |
var friendly_timezone = switchMap(tz_timezone, { | |
'America/New_York': 'Eastern', | |
'America/Chicago': 'Central', | |
'America/Denver': 'Mountain', |
OlderNewer