diff --git a/includes/class-settings.php b/includes/class-settings.php index f8805e3..04f8c14 100644 --- a/includes/class-settings.php +++ b/includes/class-settings.php @@ -90,7 +90,8 @@ class Settings { Plugin::__('Client ID'), [$this, 'the_field'], $this->get_menu_slug(), - 'api' + 'api', + ['name' => 'client_id'] ); add_settings_field( @@ -98,7 +99,8 @@ class Settings { Plugin::__('Client Secret'), [$this, 'the_field'], $this->get_menu_slug(), - 'api' + 'api', + ['name' => 'client_secret'] ); add_settings_field( @@ -106,7 +108,8 @@ class Settings { Plugin::__('Token'), [$this, 'the_field'], $this->get_menu_slug(), - 'api' + 'api', + ['name' => 'token'] ); } @@ -115,14 +118,18 @@ class Settings { printf( '', esc_attr($args['name']), - esc_attr($args['option_group']), + esc_attr($this->get_option_group()), esc_attr($args['name']), - esc_attr($this->options[$args['name']] ?? '') + esc_attr($this->get_field($args['name'])) ); if (isset($args['description']) && !empty($args['description'])) { printf('

%s

', esc_html($args['description'])); } } + + public function sanitize(array $input):array { + return array_map('sanitize_text_field', $input); + } // Output settings page