| @@ -10,20 +10,13 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | protected $form_id; |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * @var object|null | |
| 14 | + * @var object | |
| 15 | 15 | */ |
| 16 | 16 | protected $form; |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | - * @since 6.21 | |
| 20 | - * | |
| 21 | - * @var string | |
| 22 | - */ | |
| 23 | - protected $option_type = 'form'; | |
| 24 | - | |
| 25 | - /** | |
| 26 | 19 | * @param int $form_id |
| 27 | 20 | */ |
| 28 | 21 | public function __construct( $form_id ) { |
| 29 | 22 | $this->form_id = $form_id; |
| @@ -29,9 +22,9 @@ | ||
| 29 | 22 | $this->form_id = $form_id; |
| 30 | 23 | } |
| 31 | 24 | |
| 32 | 25 | /** |
| 33 | - * @return object|null Form. | |
| 26 | + * @return object $form | |
| 34 | 27 | */ |
| 35 | 28 | protected function get_form() { |
| 36 | 29 | if ( empty( $this->form ) ) { |
| 37 | 30 | $this->form = FrmForm::getOne( $this->form_id ); |
| @@ -42,16 +35,10 @@ | ||
| 42 | 35 | /** |
| 43 | 36 | * @return bool |
| 44 | 37 | */ |
| 45 | 38 | protected function is_option_on() { |
| 46 | - $key = $this->get_option_key(); | |
| 47 | - | |
| 48 | - if ( 'global' === $this->option_type ) { | |
| 49 | - $frm_settings = FrmAppHelper::get_settings(); | |
| 50 | - return ! empty( $frm_settings->$key ); | |
| 51 | - } | |
| 52 | - | |
| 53 | 39 | $form = $this->get_form(); |
| 40 | + $key = $this->get_option_key(); | |
| 54 | 41 | return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ]; |
| 55 | 42 | } |
| 56 | 43 | |
| 57 | 44 | /** |