GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-fileupload-csv.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default file upload field output template.
4  *
5  * @global \GV\Template_Context $gravityview
6  * @since 2.0
7  */
8 
9 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
10  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
11  return;
12 }
13 
14 $field = $gravityview->field->field;
15 $value = $gravityview->value;
16 $form = $gravityview->view->form->form;
17 $entry = $gravityview->entry->as_entry();
18 
19 if ( ! empty( $value ) ) {
20  $output_arr = gravityview_get_files_array( $value, '', $gravityview );
21 
22  /**
23  * @filter `gravityview/template/field/csv/glue` The value used to separate multiple values in the CSV export
24  * @since 2.4.2
25  *
26  * @param string The glue. Default: ";" (semicolon)
27  * @param \GV\Template_Context The context.
28  */
29  $glue = apply_filters( 'gravityview/template/field/csv/glue', ";", $gravityview );
30 
31  echo implode( $glue, wp_list_pluck( $output_arr, 'file_path' ) );
32 }
gravityview_get_files_array( $value, $gv_class='', $context=null)
Return an array of files prepared for output.
Definition: class-api.php:1375
gravityview()
The main GravityView wrapper function.
if(! isset( $gravityview)||empty( $gravityview->template)) $field
The default file upload field output template.