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('admin_bar_menu', 'custom_toolbar_links', 10, 1); | |
function custom_toolbar_links($wp_admin_bar) { | |
$user = wp_get_current_user(); | |
if( in_array( "staff", $user->roles ) ): | |
$wp_admin_bar->add_node(array( | |
'id' => 'hotlinks', | |
'title' => 'Hotlinks', |
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_validation_user_input', 'step_complete_data_check', 10, 3 ); | |
add_filter( 'gravityflow_validation_user_input', 'step_inprogress_bypass_required', 10, 3 ); | |
function step_complete_data_check( $validation_result, $step, $new_status ) { | |
if( ($validation_result['form']['id'] == "121" && rgpost( 'step_id' ) == 40 && $new_status == 'in_progress') ) { | |
foreach( $form['fields'] as &$field ) { | |
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 ) { | |
$new_column = array( | |
'user_action' => 'User Action', | |
); | |
$pre_columns = array_slice( $columns, 0, 2 ); | |
$post_columns = array_slice( $columns, 2 ); | |
$columns = array_merge( $pre_columns, $new_column, $post_columns ); | |
return $columns; |
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_discussion_items_display_limit', 'limit_discussion_display', 10, 2 ); | |
function limit_discussion_display( $display_limit, $discussion_field ) { | |
//Change to control which form / field the limit change is applied to | |
if ( $discussion_field['formId'] == '25' ) { | |
$display_limit = 2; | |
} | |
return $display_limit; | |
} |
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 ) { |
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
(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( "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
<?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_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 ); |