CreditCardExpiration.php 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Fields_CreditCardExpiration
  4. */
  5. class NF_Fields_CreditCardExpiration extends NF_Abstracts_Input
  6. {
  7. protected $_name = 'creditcardexpiration';
  8. protected $_type = 'creditcardexpiration';
  9. protected $_section = '';
  10. protected $_icon = 'credit-card';
  11. protected $_templates = 'textbox';
  12. protected $_test_value = '01/2025';
  13. protected $_settings_exclude = array( 'input_limit_set', 'disable_input' );
  14. public function __construct()
  15. {
  16. parent::__construct();
  17. $this->_nicename = __( 'Credit Card Expiration', 'ninja-forms' );
  18. add_filter( 'nf_sub_hidden_field_types', array( $this, 'hide_field_type' ) );
  19. $this->_settings[ 'mask' ] = array(
  20. 'name' => 'mask',
  21. 'value' => '99/9999',
  22. );
  23. }
  24. function hide_field_type( $field_types )
  25. {
  26. $field_types[] = $this->_name;
  27. return $field_types;
  28. }
  29. }