HTML.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Fields_HTML
  4. */
  5. class NF_Fields_HTML extends NF_Abstracts_Input
  6. {
  7. protected $_name = 'html';
  8. protected $_section = 'layout';
  9. protected $_icon = 'code';
  10. protected $_aliases = array( 'html' );
  11. protected $_type = 'html';
  12. protected $_templates = 'html';
  13. protected $_settings_only = array( 'label', 'default', 'classes' );
  14. protected $_use_merge_tags_include = array( 'calculations' );
  15. public function __construct()
  16. {
  17. parent::__construct();
  18. $this->_settings[ 'label' ][ 'width' ] = 'full';
  19. $this->_settings[ 'default' ][ 'group' ] = 'primary';
  20. $this->_settings[ 'default' ][ 'type' ] = 'rte';
  21. $this->_settings[ 'default' ][ 'use_merge_tags' ] = array(
  22. 'include' => array(
  23. 'calcs'
  24. ),
  25. 'exclude' => array(
  26. 'form',
  27. 'fields'
  28. ),
  29. );
  30. $this->_nicename = __( 'HTML', 'ninja-forms' );
  31. add_filter( 'nf_sub_hidden_field_types', array( $this, 'hide_field_type' ) );
  32. }
  33. function hide_field_type( $field_types )
  34. {
  35. $field_types[] = $this->_name;
  36. return $field_types;
  37. }
  38. }