Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
demountable
/
wp-content
/
plugins
/
extendify
/
src
/
Agent
/
workflows
/
settings
/
tools
:
update-wp-setting.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import apiFetch from '@wordpress/api-fetch'; import { allowedSettings } from '@agent/workflows/settings/edit-wp-setting'; 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 }, }); };