GravityView  2.10.1
The best, easiest way to display Gravity Forms entries on your website.
type_number.php
Go to the documentation of this file.
1 <?php
2 /**
3  * number input type
4  */
5 
6 if( !class_exists('GravityView_FieldType_text') ) {
7  include_once( GRAVITYVIEW_DIR . 'includes/admin/field-types/type_text.php' );
8 }
9 
11 
12  function render_input( $override_input = null ) {
13  if ( isset( $override_input ) ) {
14  echo $override_input;
15 
16  return;
17  }
18 
19  $class = '';
20 
21  $show_mt = $this->show_merge_tags();
22 
23  if ( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
24  $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
25  }
26 
27  $class .= \GV\Utils::get( $this->field, 'class', 'widefat' );
28 
29  $max = \GV\Utils::get( $this->field, 'max', null );
30  $min = \GV\Utils::get( $this->field, 'min', null );
31  $step = \GV\Utils::get( $this->field, 'step', null );
32 
33  $atts = '';
34  $atts .= $max ? ' max="' . (int) $max . '"' : '';
35  $atts .= $min ? ' min="' . (int) $min . '"' : '';
36  $atts .= $step ? ' step="' . (int) $step . '"' : '';
37  ?>
38  <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="number"
39  value="<?php echo esc_attr( $this->value ); ?>"
40  class="<?php echo esc_attr( $class ); ?>"<?php echo $atts; ?>>
41  <?php
42  }
43 
44 }
const GRAVITYVIEW_DIR
"GRAVITYVIEW_DIR" "./" The absolute path to the plugin directory, with trailing slash ...
Definition: gravityview.php:40
show_merge_tags()
Verify if field should have merge tags.
render_input( $override_input=null)
Definition: type_number.php:12
$class
text input type
Definition: type_text.php:5
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.