1 | <?php |
||
13 | class EmailLogSetting extends Setting { |
||
14 | |||
15 | /** |
||
16 | * Implement `initialize()` method. |
||
17 | */ |
||
18 | protected function initialize() { |
||
19 | $this->section->id = 'email-log'; |
||
20 | $this->section->title = __( 'Email Log Settings', 'email-log' ); |
||
21 | $this->section->option_name = 'el_email_log_core'; |
||
22 | |||
23 | $this->load(); |
||
24 | } |
||
25 | |||
26 | public function get_fields() { |
||
27 | $fields = array(); |
||
28 | |||
29 | $email_log_fields = array( |
||
30 | 'allowed_user_roles' => __( 'Allowed User Roles', 'email-log' ), |
||
31 | 'remove_on_uninstall' => __( 'Remove Data on Uninstall?', 'email-log' ), |
||
32 | ); |
||
33 | |||
34 | foreach ( $email_log_fields as $field_id => $label ) { |
||
35 | $field = new SettingField(); |
||
36 | $field->id = $field_id; |
||
37 | $field->title = $label; |
||
38 | $field->args = array( 'id' => $field_id ); |
||
39 | $field->callback = array( $this,'render_' . $field_id . '_settings' ); |
||
40 | |||
41 | $fields[] = $field; |
||
42 | } |
||
43 | |||
44 | return $fields; |
||
45 | } |
||
46 | |||
47 | public function render() { |
||
52 | |||
53 | /** |
||
54 | * Implement `sanitize()` method. |
||
55 | * |
||
56 | * @param mixed $values {@inheritDoc} |
||
57 | * |
||
58 | * @return mixed $values {@inheritDoc} |
||
59 | */ |
||
60 | public function sanitize( $values ) { |
||
75 | |||
76 | /** |
||
77 | * Renders the Email Log `Allowed User Roles` settings. |
||
78 | * |
||
79 | * @param array $args |
||
80 | */ |
||
81 | public function render_allowed_user_roles_settings( $args ) { |
||
102 | |||
103 | /** |
||
104 | * Renders the Email Log `Remove Data on Uninstall?` settings. |
||
105 | * |
||
106 | * @param array $args |
||
107 | */ |
||
108 | public function render_remove_on_uninstall_settings( $args ) { |
||
115 | } |