GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
website.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the website field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  */
8 
10 
11 extract( $gravityview_view->getCurrentField() );
12 
13 if( !empty( $value ) && function_exists( 'gravityview_format_link' ) ) {
14 
15  /** @since 1.8 */
16  $anchor_text = !empty( $field_settings['anchor_text'] ) ? trim( rtrim( $field_settings['anchor_text'] ) ) : false;
17 
18  // Check empty again, just in case trim removed whitespace didn't work
19  if( !empty( $anchor_text ) ) {
20 
21  // Replace the variables
22  $anchor_text = GravityView_API::replace_variables( $anchor_text, $form, $entry );
23 
24  } else {
25  $anchor_text = empty( $field_settings['truncatelink'] ) ? $value : gravityview_format_link( $value );
26  }
27 
28  $attributes = empty( $field_settings['open_same_window'] ) ? 'target=_blank' : '';
29 
30  echo gravityview_get_link( $value, $anchor_text, $attributes );
31 
32 } else {
33  echo $display_value;
34 }
static replace_variables($text, $form=array(), $entry=array())
Alias for GravityView_Merge_Tags::replace_variables()
Definition: class-api.php:102
$field_settings['content']
Definition: custom.php:27
gravityview_get_link($href= '', $anchor_text= '', $atts=array())
Generate an HTML anchor tag with a list of supported attributes.
static getInstance($passed_post=NULL)
gravityview_format_link($value=null)
Convert a whole link into a shorter link for display.
$entry
Definition: notes.php:27
$gravityview_view
Definition: website.php:9