GravityView  2.9.2
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields
GravityView_Field_FileUpload Class Reference
Inheritance diagram for GravityView_Field_FileUpload:
GravityView_Field

Public Member Functions

 __construct ()
 
 field_options ( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
 
 get_field_input ( $form, $field_value, $entry, $field)
 Trick the GF fileupload field to render with the proper HTML ID to enable the plupload JS to work properly. More...
 
- Public Member Functions inherited from GravityView_Field
 __construct ()
 GravityView_Field constructor. More...
 
 _filter_gform_custom_merge_tags ( $custom_merge_tags=array(), $form_id, $fields=array(), $element_id='')
 Add custom merge tags to merge tag options. More...
 
 _filter_gform_replace_merge_tags ( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
 Match the merge tag in replacement text for the field. More...
 
 _filter_sortable_fields ( $not_sortable)
 Use field settings to modify whether a field is sortable. More...
 
 add_entry_meta ( $entry_meta)
 Add the custom entry meta key to make it searchable and sortable. More...
 
 add_field_support ( $key='', &$field_options)
 
 add_sortable_field ( $fields)
 Add the field to the Filter & Sort available fields. More...
 
 field_options ( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
 Tap in here to modify field options. More...
 
 replace_merge_tag ( $matches=array(), $text='', $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
 Run GravityView filters when using GFCommon::replace_variables() More...
 
 set_default_search_label ( $label='', $gf_field=null, $field=array())
 Allow setting a default search label for search fields based on the field type. More...
 

Static Public Member Functions

static get_files_array ( $value, $gv_class, $context=null)
 Return an array of files prepared for output. More...
 

Data Fields

 $_gf_field_class_name = 'GF_Field_FileUpload'
 
 $group = 'advanced'
 
 $is_searchable = true
 
 $name = 'fileupload'
 
 $search_operators = array( 'contains' )
 
- Data Fields inherited from GravityView_Field
 $_gf_field_class_name
 
 $contexts = array( 'single', 'multiple', 'edit', 'export' )
 
 $default_search_label
 
 $description
 
 $entry_meta_is_default_column = false
 
 $entry_meta_key = null
 
 $entry_meta_update_callback = null
 
 $group
 standard, advanced, post, pricing, meta, gravityview More...
 
 $is_numeric
 
 $is_searchable = true
 
 $is_sortable = true
 
 $label
 
 $name
 
 $search_operators
 

Additional Inherited Members

- Protected Member Functions inherited from GravityView_Field
 custom_merge_tags ( $form=array(), $fields=array())
 Add custom Merge Tags to Merge Tag options, if custom Merge Tags exist. More...
 
 is_choice_value_enabled ()
 Check whether the enableChoiceValue flag is set for a GF field. More...
 
- Protected Attributes inherited from GravityView_Field
 $_custom_merge_tag = false
 
 $_field_id = ''
 
 $_field_options = array()
 

Detailed Description

Definition at line 8 of file class-gravityview-field-fileupload.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 20 of file class-gravityview-field-fileupload.php.

Member Function Documentation

◆ field_options()

field_options (   $field_options,
  $template_id,
  $field_id,
  $context,
  $input_type,
  $form_id 
)

Definition at line 25 of file class-gravityview-field-fileupload.php.

◆ get_field_input()

get_field_input (   $form,
  $field_value,
  $entry,
  $field 
)

Trick the GF fileupload field to render with the proper HTML ID to enable the plupload JS to work properly.

Parameters
array$formThe Form Object currently being processed.
string | array$valueThe field value. From default/dynamic population, $_POST, or a resumed incomplete submission.
null | array$entryNull or the Entry Object currently being edited.
GF_Field_FileUpload$fieldGravity Forms field
Returns
string

Definition at line 62 of file class-gravityview-field-fileupload.php.

References $entry, $field, $field_value, and GV\$form.

◆ get_files_array()

static get_files_array (   $value,
  $gv_class,
  $context = null 
)
static

Return an array of files prepared for output.

Processes files by file type and generates unique output for each. Returns array for each file, with the following keys:

  • file_path => The file path of the file, with a line break
  • html => The file output HTML formatted
Since
1.2
Parameters
string$valueField value passed by Gravity Forms. String of file URL, or serialized string of file URL array
string$gv_classField class to add to the output HTML
Since
2.0
Parameters

A compatibility array that's required by some of the deprecated filters.

Parameters
GF_Field_FileUpload$field
Runs Filter:
gravityview/fields/fileupload/file_path Modify the file path before generating a link to it
Since
1.22.3
2.0 Added $context parameter
2.8.2
Parameters
string$file_pathPath to the file uploaded by Gravity Forms
array$field_settingsArray of GravityView field settings
\GV\Template_Context$contextThe context.
int$indexThe current index of the $file_paths array being processed
Runs Filter:
gravityview_audio_settings Modify the settings passed to the wp_video_shortcode() function
Since
1.2
Parameters
array$audio_settingsArray with src and class keys
Since
2.0
Parameters
\GV\Template_Context$contextThe context.

Generate the audio shortcode

See also
http://codex.wordpress.org/Audio_Shortcode
https://developer.wordpress.org/reference/functions/wp_audio_shortcode/

noop

Runs Filter:
gravityview_video_settings Modify the settings passed to the wp_video_shortcode() function
Since
1.2
Parameters
array$video_settingsArray with src and class keys
Since
2.0
Parameters
\GV\Template_Context$contextThe context.

Generate the video shortcode

See also
http://codex.wordpress.org/Video_Shortcode
https://developer.wordpress.org/reference/functions/wp_video_shortcode/

noop

Modify the default image attributes for uploaded images

Since
2.0
See also
GravityView_Image For the available attributes
Parameters
array$image_atts
Runs Filter:
gravityview/fields/fileupload/allow_insecure_lightbox Allow insecure links to be shown for the lighbox. Thickbox doesn't work with secure URLs :(
Parameters
[in,out]boolTrue or not. DANGER! DANGER! Default: false! Override at your own RISK!!!
array$field_settingsThe field settings.
\GV\Template_Context$contextThe context.
Runs Filter:
gravityview/fields/fileupload/disable_link Filter to alter the default behaviour of wrapping images (or image names) with a link to the content object
Since
1.5.1
Parameters
bool$disable_wrapped_linkwhether to wrap the content with a link to the content object.
array$field_compatCurrent GravityView field array
See also
GravityView_API:field_value() for info about $gravityview_view->field_data
Since
2.0
Parameters
\GV\Template_Context$contextThe context.

Modify the link text (defaults to the file name)

Since
1.7
Parameters
string$contentThe existing anchor content. Could be <img> tag, audio/video embed or the file name
array$field_compatCurrent GravityView field array
Since
2.0
Parameters
\GV\Template_Context$contextThe context.
Runs Filter:
gravityview/fields/fileupload/link_atts Modify the link attributes for a file upload field
Parameters
array | string$link_attsArray or attributes string
array$field_compatCurrent GravityView field array
Since
2.0
Parameters
\GV\Template_Context$contextThe context.
Runs Filter:
gravityview/fields/fileupload/files_array Modify the files array
Since
1.7
Parameters
array$output_arrAssociative array of files
string$file_pathThe path to the file as stored in Gravity Forms
string$contentThe generated output for the file
array$field_compatCurrent GravityView field array
Since
2.0
Parameters
\GV\Template_Context$contextThe context.

Definition at line 88 of file class-gravityview-field-fileupload.php.

References $content, $entry, $entry_slug, $field, $field_settings, $field_value, $gravityview_view, $image, $image_atts, $link_atts, $post, $value, GF_Entry\from_entry(), Utils\get(), GravityView_View\getInstance(), gravityview(), gravityview_get_context(), and gravityview_get_link().

Referenced by gravityview_get_files_array().

Field Documentation

◆ $_gf_field_class_name

$_gf_field_class_name = 'GF_Field_FileUpload'

Definition at line 12 of file class-gravityview-field-fileupload.php.

◆ $group

$group = 'advanced'

Definition at line 18 of file class-gravityview-field-fileupload.php.

◆ $is_searchable

$is_searchable = true

Definition at line 14 of file class-gravityview-field-fileupload.php.

◆ $name

$name = 'fileupload'

Definition at line 10 of file class-gravityview-field-fileupload.php.

◆ $search_operators

$search_operators = array( 'contains' )

Definition at line 16 of file class-gravityview-field-fileupload.php.


The documentation for this class was generated from the following file: