Submit.php 865 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Field_Button
  4. */
  5. class NF_Fields_Submit extends NF_Fields_Button
  6. {
  7. protected $_name = 'submit';
  8. protected $_section = 'common';
  9. protected $_icon = 'square';
  10. protected $_type = 'submit';
  11. protected $_templates = 'submit';
  12. protected $_wrap_template = 'wrap-no-label';
  13. protected $_settings = array( 'label', 'timed_submit', 'processing_label', 'classes', 'key' );
  14. public function __construct()
  15. {
  16. parent::__construct();
  17. $this->_nicename = __( 'Submit', 'ninja-forms' );
  18. $this->_settings[ 'label' ][ 'width' ] = 'full';
  19. add_filter( 'nf_sub_hidden_field_types', array( $this, 'hide_field_type' ) );
  20. }
  21. function hide_field_type( $field_types )
  22. {
  23. $field_types[] = $this->_name;
  24. return $field_types;
  25. }
  26. }