Fix field render issues.
This commit is contained in:
@@ -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,15 +118,19 @@ class Settings {
|
||||
printf(
|
||||
'<input id="%s" name="%s[%s]" type="text" value="%s" />',
|
||||
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('<p class="description">%s</p>', esc_html($args['description']));
|
||||
}
|
||||
}
|
||||
|
||||
public function sanitize(array $input):array {
|
||||
return array_map('sanitize_text_field', $input);
|
||||
}
|
||||
|
||||
// Output settings page
|
||||
|
||||
public function render():void {
|
||||
|
||||
Reference in New Issue
Block a user