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 | |
$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_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 | |
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_action( 'gravityflow_workflow_complete', 'workflow_finish_complete_status', 5, 3 ); | |
function workflow_finish_complete_status( $entry_id, $form, $final_status ) { | |
if ( $form['id'] == '31' ) { | |
if ( $final_status == 'approved' ) { | |
$entry = GFAPI::get_entry( $entry_id ); | |
if ( $entry ) { | |
$entry['workflow_final_status'] = 'complete'; | |
$result = GFAPI::update_entry( $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 | |
add_filter( 'gravityflow_step_schedule_timestamp', 'schedule_business_hours', 10, 3 ); | |
function schedule_business_hours( $schedule_timestamp, $schedule_type, $step ) { | |
//Ensure you are only adjusting the desired form/step | |
if ( $step->get_id() !== 74 ) { | |
return $schedule_timestamp; | |
} | |
gravity_flow()->log_debug( __METHOD__ . '(): Original Scheduled: ' . date( 'Y-m-d H:i:s', $schedule_timestamp ) ); |
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( "gform_rest_api_capability_get_entries", "gfapi2_authorization_by_form", 10, 2); | |
function gfapi2_authorization_by_form( $capability, $request ) { | |
$form_id = $request->get_param("form_id"); | |
if( $form_id == '16' ) { | |
$capability = 'read'; | |
} | |
return $capability; | |
} |
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 (GravityFlowEntryDetail, $) { | |
$(document).ready(function () { | |
if( $('.gravityflow-step-user_input').length ) { | |
//User Input - Save Progress Button | |
if( $('#gravityflow_save_progress_button').length ) { | |
$('#gravityflow_save_progress_button')[0].onclick = null; | |
$('#gravityflow_save_progress_button').click(function() { | |
$('#action').val('update'); |
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_columns_status_table', 'custom_column_titles', 10, 3 ); | |
function custom_column_titles( $columns, $args, $table ) { | |
$columns['last_updated'] = 'Last Updated'; | |
return $columns; | |
} | |
add_filter( 'gravityflow_field_value_status_table', 'custom_column_field_values', 10, 4 ); | |
function custom_column_field_values( $value, $form_id, $column_name, $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 | |
add_filter( 'gform_export_fields', 'add_step_updated', 10, 1 ); | |
function add_step_updated( $form ) { | |
array_push( $form['fields'], array( 'id' => 'step_updated', 'label' => __( 'Step Last Updated', 'gravityforms' ) ) ); | |
return $form; | |
} | |
add_filter( 'gform_export_field_value', 'set_step_updated', 10, 4 ); | |
function set_step_updated( $value, $form_id, $field_id, $entry ) { | |
switch ( $field_id ) { |