[ Index ]

MailPress 7.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/options/form/field_types/checkbox/ -> checkbox.php (source)

   1  <?php
   2  class MP_Form_field_type_checkbox extends MP_form_field_type_
   3  {
   4      var $file        = __FILE__;
   5  
   6      var $id        = 'checkbox';
   7  
   8      var $category     = 'html';
   9  
  10      var $order        = 30;
  11  
  12  	function submitted( $field )
  13      {
  14          $this->field = $field;
  15  
  16          $value = $this->get_value();
  17  
  18          if ( !isset( $value ) )
  19          {
  20              $this->field->submitted['value'] = false;
  21              $this->field->submitted['text']  = __( 'not checked', 'MailPress' );
  22              return $this->field;
  23          }
  24          return parent::submitted( $this->field );
  25      }
  26  
  27  	function attributes_filter( $no_reset )
  28      {
  29          if ( !$no_reset ) return;
  30  
  31          $value = $this->get_value();
  32  
  33          unset( $this->field->settings['attributes']['checked'] );
  34          if ( isset( $value ) ) $this->field->settings['attributes']['checked'] = 'checked';
  35  
  36          $this->attributes_filter_css();
  37      }
  38  }
  39  new MP_Form_field_type_checkbox( __( 'Checkbox', 'MailPress' ) );


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1