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 | |
add_filter( 'gravityflow_step_assignees', 'bypass_step_assignee_on_email_change', 10, 2 ); | |
function bypass_step_assignee_on_email_change( $assignees, $step ) { | |
//Update with the ID of your specific step to apply the bypass against | |
if ( $step->get_id() == '76' ) { | |
if ( isset( $_POST['gforms_save_entry'] ) && count( $_POST ) > 0 ) { | |
$reset = false; | |
if ( $assignees ) { | |
foreach ( $assignees as $key => $assignee ) { |
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 | |
add_filter( "gravityflow_user_field", "gflow_request_manager", 10, 3 ); | |
function gflow_request_manager( $choices, $form_id, $field ) { | |
if ( $form_id == 1 && $field->id == 15 ) { | |
$manager = get_user_by('email', get_user_meta(get_current_user_id(), "manager_email", true) ); | |
if( false !== $manager ) { | |
$choices = array( | |
array('value' => $manager->ID, 'text' => $manager->first_name . ' ' . $manager->last_name) |
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 | |
$API = new Gravity_Flow_API( '1' ); | |
$form = GFAPI::get_form( '1' ); | |
require_once( gravity_flow()->get_base_path() . '/includes/pages/class-entry-detail.php' ); | |
$notes = Gravity_Flow_Entry_Detail::get_timeline_notes( $entry ); | |
$output = "<H3>Timeline</h3><ul>"; | |
foreach( $notes as $note): | |
if( $note->user_name !== 'notification' && $note->value !== 'Step expired' ): |
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 | |
add_filter('gravityflow_inbox_args', 'registrations_inbox_form_ids', 10, 1); | |
function registrations_inbox_form_ids( $args ) { | |
//Specify which instance of the shortcode you want to affect | |
if( false !== strpos($args['detail_base_url'], '/event-registrations/') ) { | |
$registrations = array( '106, '107'); | |

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 | |
add_action( 'rest_api_init', 'rest_register_game_meta' ); | |
function rest_register_game_meta() { | |
//For generic fields that should never allow front-end updates | |
$restArgsDisplay = array( | |
'get_callback' => 'rest_get_game_meta', | |
'update_callback' => null, | |
'schema' => null, |
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 | |
//replace ## with your form ID - and also update field IDs with your appropriate numbers. | |
add_action( "gform_pre_submission_##", "employee_lookup_and_assignment", 10, 1 ); | |
function employee_lookup_and_assignment( $form ) { | |
$reviewer = get_user_by( 'email', rgpost( 'input_12' )); | |
if( $reviewer ): | |
$_POST['input_10'] = "user_id|" . $reviewer->ID; | |
endif; |
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
#!/bin/bash | |
INPUT=input_filename.csv | |
OLDIFS=$IFS | |
IFS=, | |
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } | |
while read reviewer employee | |
do | |
f10=$(wp user get $reviewer --field=ID) | |
f11=$(wp user get $employee --field=ID) | |
f14=$(wp user meta get $employee user_meta_field_name) |
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
(function($) { | |
acf.add_action('ready', function( $el ){ | |
//Identify the field you want to check against. | |
//Use a class to handle scenarios involving repeater / flexible content where multiple instances exist | |
var $field = $('.example input'); | |
$field.on('change', function (evt) { |
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 | |
//REST API - Enable more fields to be searched via Rest API | |
add_filter( 'rest_query_vars', function ( $valid_vars ) { | |
$update_vars = $valid_vars; | |
//Vehicle Meta Data | |
$update_vars = array_merge( $update_vars, array( 'make', 'meta_query' ) ); | |
$update_vars = array_merge( $update_vars, array( 'model', 'meta_query' ) ); | |
return $update_vars; |