| 1 |
import apiFetch from '@wordpress/api-fetch'; |
| 2 |
import { __ } from '@wordpress/i18n'; |
| 3 |
|
| 4 |
const path = '/extendify/v1/agent/site-options'; |
| 5 |
|
| 6 |
export const options = { |
| 7 |
name: 'extendify/options', |
| 8 |
label: __('Site settings', 'extendify-local'), |
| 9 |
description: |
| 10 |
'Read the settings this site stores, which is where WordPress, its theme and its plugins each keep their configuration. The address the site sends mail to is admin_email. Search by part of a name to find where something is kept, or name the settings to read them outright.', |
| 11 |
inputSchema: { |
| 12 |
type: 'object', |
| 13 |
properties: { |
| 14 |
search: { |
| 15 |
type: 'string', |
| 16 |
description: |
| 17 |
'Part of a setting name, such as the prefix a plugin puts on its own.', |
| 18 |
}, |
| 19 |
name: { |
| 20 |
type: 'string', |
| 21 |
description: 'A setting to read.', |
| 22 |
}, |
| 23 |
names: { |
| 24 |
type: 'array', |
| 25 |
items: { type: 'string' }, |
| 26 |
description: 'Several settings to read at once.', |
| 27 |
}, |
| 28 |
}, |
| 29 |
}, |
| 30 |
annotations: { readonly: true }, |
| 31 |
execute: (input = {}) => apiFetch({ path, method: 'POST', data: input }), |
| 32 |
}; |
| 33 |
|