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_action( 'gravityview/edit_entry/after_update', 'gv_custom_function', 10, 3 ); | |
| function gv_custom_function( $form = array(), $entry_id = array(), $object ){ | |
| $run_on_views = [4049]; //Change this to the IDs of the Views you'd like to run this code | |
| $view_id = GravityView_View::getInstance()->getViewId(); | |
| if( !in_array( $view_id, $run_on_views ) ){ | |
| return false; |
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 | |
| $binder = new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder(); | |
| add_filter( 'gfexcel_renderer_cell_properties_2', function ( \PhpOffice\PhpSpreadsheet\Cell\Cell $cell, \GFExcel\Values\BaseValue $value ) use ( $binder ) { | |
| if ( $value->getFieldId() == 6 && $cell->getRow() > 1 ) { | |
| $old_binder = \PhpOffice\PhpSpreadsheet\Cell\Cell::getValueBinder(); | |
| \PhpOffice\PhpSpreadsheet\Cell\Cell::setValueBinder( $binder ); | |
| $cell->setValue( $value->getValue() ); | |
| $cell |
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_filter( 'gform_secure_file_download_location', '__return_false' ); | |
| add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value ) { | |
| if ( 'all_fields' !== $merge_tag && 'linker' === $modifier ) { | |
| // Split on <br> tags, line breaks, or commas | |
| $files = preg_split('/<br\s*\/?>|\r\n|\r|\n|,/', trim($value)); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ); |
NewerOlder