GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-phone-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default phone 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 $value = $gravityview->value;
15 $field_settings = $gravityview->field->as_configuration();
16 
17 $value = esc_attr( $value );
18 
19 if( ! empty( $field_settings['link_phone'] ) && ! empty( $value ) ) {
20  echo gravityview_get_link( 'tel:' . $value, $value );
21 } else {
22  echo $value;
23 }
$field_settings
if(! isset( $gravityview)||empty( $gravityview->template)) $value
The default phone field output template.
gravityview_get_link( $href='', $anchor_text='', $atts=array())
Generate an HTML anchor tag with a list of supported attributes.
gravityview()
The main GravityView wrapper function.