StarRating.php 781 B

123456789101112131415161718192021222324252627282930313233
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Fields_StarRating
  4. */
  5. class NF_Fields_StarRating extends NF_Abstracts_Input
  6. {
  7. protected $_name = 'starrating';
  8. protected $_section = 'misc';
  9. protected $_icon = 'star-half-o';
  10. protected $_aliases = array( 'rating' );
  11. protected $_type = 'starrating';
  12. protected $_templates = 'starrating';
  13. protected $_settings_only = array( 'label', 'label_pos', 'default',
  14. 'number_of_stars', 'required', 'classes', 'key', 'admin_label' );
  15. public function __construct()
  16. {
  17. parent::__construct();
  18. // Put this in the primary settings group
  19. $this->_settings['number_of_stars']['group'] = 'primary';
  20. $this->_nicename = __( 'Star Rating', 'ninja-forms' );
  21. }
  22. }