class-evf-settings-email.php
3 years ago
class-evf-settings-general.php
5 years ago
class-evf-settings-integrations.php
6 years ago
class-evf-settings-misc.php
2 years ago
class-evf-settings-page.php
7 years ago
class-evf-settings-recaptcha.php
2 years ago
class-evf-settings-validation.php
6 years ago
class-evf-settings-general.php
80 lines
| 1 | <?php |
| 2 | /** |
| 3 | * EverestForms General Settings |
| 4 | * |
| 5 | * @package EverestForms\Admin |
| 6 | * @version 1.0.0 |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | if ( class_exists( 'EVF_Settings_General', false ) ) { |
| 12 | return new EVF_Settings_General(); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * EVF_Settings_General. |
| 17 | */ |
| 18 | class EVF_Settings_General extends EVF_Settings_Page { |
| 19 | |
| 20 | /** |
| 21 | * Constructor. |
| 22 | */ |
| 23 | public function __construct() { |
| 24 | $this->id = 'general'; |
| 25 | $this->label = esc_html__( 'General', 'everest-forms' ); |
| 26 | |
| 27 | parent::__construct(); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Get settings array. |
| 32 | * |
| 33 | * @return array |
| 34 | */ |
| 35 | public function get_settings() { |
| 36 | $settings = apply_filters( |
| 37 | 'everest_forms_general_settings', |
| 38 | array( |
| 39 | array( |
| 40 | 'title' => esc_html__( 'General Options', 'everest-forms' ), |
| 41 | 'type' => 'title', |
| 42 | 'desc' => '', |
| 43 | 'id' => 'general_options', |
| 44 | ), |
| 45 | array( |
| 46 | 'title' => esc_html__( 'Disable User Details', 'everest-forms' ), |
| 47 | 'desc' => esc_html__( 'Disable storing the IP address and User Agent on all forms.', 'everest-forms' ), |
| 48 | 'id' => 'everest_forms_disable_user_details', |
| 49 | 'default' => 'no', |
| 50 | 'type' => 'checkbox', |
| 51 | ), |
| 52 | array( |
| 53 | 'title' => esc_html__( 'Enable Log', 'everest-forms' ), |
| 54 | 'desc' => esc_html__( 'Enable storing the logs.', 'everest-forms' ), |
| 55 | 'id' => 'everest_forms_enable_log', |
| 56 | 'default' => 'no', |
| 57 | 'type' => 'checkbox', |
| 58 | ), |
| 59 | array( |
| 60 | 'type' => 'sectionend', |
| 61 | 'id' => 'general_options', |
| 62 | ), |
| 63 | ) |
| 64 | ); |
| 65 | |
| 66 | return apply_filters( 'everest_forms_get_settings_' . $this->id, $settings ); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Save settings. |
| 71 | */ |
| 72 | public function save() { |
| 73 | $settings = $this->get_settings(); |
| 74 | |
| 75 | EVF_Admin_Settings::save_fields( $settings ); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | return new EVF_Settings_General(); |
| 80 |