# extendify/3.0.4/src/Agent/workflows/settings/tools/update-wp-setting.js

Extendify, version 3.0.4. 14 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.0.4/code/src/Agent/workflows/settings/tools/update-wp-setting.js
- Raw: https://pluginprobe.com/plugins/extendify/3.0.4/raw/src/Agent/workflows/settings/tools/update-wp-setting.js
- Modified: 2026-02-18T22:27:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.0.4/code/src/Agent/workflows/settings/tools/update-wp-setting.js#L10-L20`.

```javascript
import { allowedSettings } from '@agent/workflows/settings/edit-wp-setting';
import apiFetch from '@wordpress/api-fetch';

export default async ({ settingName, newSettingValue }) => {
	if (!allowedSettings.includes(settingName)) {
		throw new Error('Setting not allowed');
	}
	return await apiFetch({
		path: '/wp/v2/settings?context=edit',
		method: 'POST',
		data: { [settingName]: newSettingValue },
	});
};

```
