hr.php 878 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Fields_Hr
  4. */
  5. class NF_Fields_Hr extends NF_Abstracts_Input
  6. {
  7. protected $_name = 'hr';
  8. protected $_section = 'layout';
  9. protected $_icon = 'arrows-h';
  10. protected $_aliases = array( 'html' );
  11. protected $_type = 'hr';
  12. protected $_templates = 'hr';
  13. protected $_settings_only = array( 'classes' );
  14. public function __construct()
  15. {
  16. parent::__construct();
  17. $this->_settings[ 'classes' ][ 'group' ] = 'primary';
  18. $this->_nicename = __( 'Divider', 'ninja-forms' );
  19. add_filter( 'nf_sub_hidden_field_types', array( $this, 'hide_field_type' ) );
  20. unset( $this->_settings[ 'classes' ][ 'settings' ][ 'wrapper '] );
  21. }
  22. function hide_field_type( $field_types )
  23. {
  24. $field_types[] = $this->_name;
  25. return $field_types;
  26. }
  27. }