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 // DO NOT COPY THIS LINE | |
/** | |
* Output a custom image icon for every uploaded file type in GravityView. | |
* | |
* @filter gravityview/fields/fileupload/files_array | |
* | |
* @param array $output_arr Array of uploaded files passed by GravityView. | |
* @return array Modified array with icon-image output. | |
*/ |
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 // DO NOT COPY THIS LINE | |
/** | |
* Replace File-Upload output with an icon that matches the file type. | |
* | |
* @see https://github.com/GravityKit/GravityView/blob/a6584d8a/includes/fields/class-gravityview-field-fileupload.php#L455 | |
* @filter gravityview/fields/fileupload/files_array | |
* | |
* @param array $output_arr Array of files, one item per uploaded file. | |
* @return array Modified array with icon-only output. |
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 // DO NOT COPY THIS LINE | |
/** | |
* Remove the “Due” choice from a specific Drop Down field. | |
* | |
* – change 123 to your form ID | |
* – change 456 to your View ID | |
* – change 789 to your dropdown 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 // DO NOT COPY THIS LINE | |
/** | |
* Add a note whenever a Gravity Forms entry is moved to the Trash. | |
* | |
* Hook: gform_update_status — fires when an entry’s status changes | |
* (e.g., active → trash, spam → active). | |
*/ | |
add_action( 'gform_update_status', 'gk_note_on_trash', 10, 3 ); |
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 // DO NOT COPY THIS LINE | |
/** | |
* Change GravityExport Lite export filename. | |
* | |
* Hook: gfexcel_renderer_filename ← all forms | |
* gfexcel_renderer_filename_{ID} ← one specific form | |
* | |
* @param string $filename The filename generated by the plugin. | |
* @param int $form_id (Since v1.6) ID of the form being exported. |
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 // DO NOT COPY THIS LINE | |
function custom_duplicate_gf_entry( $entry_id ) { | |
if ( ! class_exists( 'GravityView_Duplicate_Entry' ) ) { | |
return new WP_Error( 'missing_class', 'GravityView_Duplicate_Entry class not found.' ); | |
} | |
$entry = GFAPI::get_entry( $entry_id ); | |
if ( is_wp_error( $entry ) ) { | |
return $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
add_filter( 'gravityflow_field_filters_status_table', 'field_filters_status_expired', 10, 1 ); | |
function field_filters_status_expired( $field_filters ) { | |
foreach ( $field_filters as $form => $filters ) { | |
if ( $form == '185' ) { // CHANGE 185 WITH YOUR FORM ID | |
$field_filters[ $form ][] = array( | |
'key' => 'is_approved', | |
'text' => 'View Approval Status', | |
'operators' => array ( 'is', 'isnot' ), | |
'values' => array( | |
array( 'value' => '1', 'text' => 'Approved' ), |
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 // DO NOT COPY THIS LINE | |
function custom_cancel_onclick_js( $back_link, $form, $entry, $view_id, $update_count ) { | |
$run_on_views = [2334]; //Change this to the IDs of the Views you'd like to run this filter [100,200,300,...] | |
if( in_array( $view_id, $run_on_views ) ){ | |
return 'window.parent.postMessage({closeFancybox: true}, "*"); return false;'; | |
} | |
} | |
add_filter( 'gravityview/edit_entry/cancel_onclick', 'custom_cancel_onclick_js', 100, 5 ); |
NewerOlder