Skip to content
Snippets Groups Projects
Commit 97e001e0 authored by Lucas García's avatar Lucas García
Browse files

feat: settings rest api schemas

parent 104359b8
No related branches found
No related tags found
1 merge request!3Git submodules
Pipeline #128591 failed
......@@ -20,20 +20,44 @@ class Settings extends BaseSettings
{
$setting_name = $this->group_name . '_general';
$this->register_setting($setting_name, [
'notification_receiver' => [
'type' => 'string'
],
], [
'notification_receiver' => 'admin@' . parse_url(get_bloginfo('url'))['host'],
'api_protocol' => 'JSON-RPC',
]);
$setting_name = $this->group_name . '_api';
$this->register_setting($setting_name, [
'endpoints' => [
[
'endpoint' => null,
'form_id' => null,
'ref' => null
$this->register_setting(
$setting_name,
[
'protocol' => [
'type' => 'string',
'enum' => [
'JSON-RPC',
'JSON-REST'
]
],
'endpoints' => [
'type' => 'array',
'items' => [
'form_id' => 'number',
'endpoint' => 'string',
'ref' => 'string',
]
]
],
[
'protocol' => 'JSON-RPC',
'endpoints' => [
[
'endpoint' => '/wp-json/wp/v2',
'form_id' => 0,
'ref' => ''
]
]
]
]);
);
}
protected function input_render($setting, $field, $value)
......
Subproject commit 7cd7cea6a7180dc90809ef7d91a40cfdb2e42c4f
Subproject commit 427059d1c82c9506b9471f63c1c5700be7ceb653
Subproject commit a3b5e7e89f1182d0517193c868b9c1018c8321bd
Subproject commit b4cfb8c2641380f160f5f147f5b6167a4d2fcba3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment