GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-creditcard-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default creditcard 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_id = $gravityview->field->ID;
15 
16 $is_single_input = floor( $field_id ) !== floatval( $field_id );
17 
18 $output = '';
19 
20 if ( ! $is_single_input ) {
21  /** Only allow the linebreak. */
22  $output = wp_kses( $gravityview->display_value, array( 'br' => array() ) );
23 } else {
25  case 1:
26  case 4:
27  $output = esc_html( \GV\Utils::get( $gravityview->value, $field_id ) );
28  default:
29  /** For security reasons only masked number and type are shown. */
30  break;
31  }
32 }
33 
34 echo $output;
if(! isset( $gravityview)||empty( $gravityview->template)) $field_id
The default creditcard field output template.
gravityview_get_input_id_from_id( $field_id='')
Very commonly needed: get the # of the input based on a full field ID.
gravityview()
The main GravityView wrapper function.