Disable Wrapping Images with a Link

For Version 1.5.1+

By default, GravityView wraps images in a link. This link references the original image by default.

If you would like to disable this functionality, use the gravityview/fields/fileupload/disable_link filter.

The gravityview/fields/fileupload/disable_link filter

The filter alters the default behaviour of wrapping images (or image names) with a link to the content object.

Default Value

  • $disable_wrapped_link is false by default
  • If the file is a video or audio, $disable_wrapped_link is true
  • If the "Link to File" field setting is enabled, $disable_wrapped_link is false

Passed Parameters

  • $disable_wrapped_link (boolean) Whether to wrap the content with a link to the content object
  • $field_data (array) Field data, as set by the GravityView_API:field_value() method. Contains information about the current view, form, entry stored in an associative array. As of 1.5.1, the array data contains:
    'form' => $form,
    'field_id' => $field_id,
    'field' => $field,
    'field_settings' => $field_settings,
    'value' => $value,
    'display_value' => $display_value,
    'format' => $format,
    'entry' => $entry,<br>
    	

Code Sample

add_filter( 'gravityview/fields/fileupload/disable_link', '__return_true');