Created
October 26, 2023 01:35
-
-
Save rafaehlers/1a75c7e7ca92b174e49ac5b3d3a801a5 to your computer and use it in GitHub Desktop.
Modify the output of a File Upload field
This file contains 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('gravityview/fields/fileupload/files_array', 'gv_modify_files_output',10,1); | |
function gv_modify_files_output($output_arr){ | |
foreach ($output_arr as $key => $value) { | |
$output_arr[$key]['content'] = '<a href="'.$value['file_path'].'" target="_blank"><span class="dashicons dashicons-media-default"></span></a>'; | |
} | |
return $output_arr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment