# extendify/3.1.0/src/Agent/workflows/settings/tools/get-wp-setting.js

Extendify, version 3.1.0. 20 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.0/code/src/Agent/workflows/settings/tools/get-wp-setting.js
- Raw: https://pluginprobe.com/plugins/extendify/3.1.0/raw/src/Agent/workflows/settings/tools/get-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.1.0/code/src/Agent/workflows/settings/tools/get-wp-setting.js#L10-L20`.

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

export default async ({ settingName }) => {
	if (!allowedSettings.includes(settingName)) {
		throw new Error('Setting not allowed');
	}
	const response = await apiFetch({
		path: '/wp/v2/settings?context=edit',
	});

	return {
		oldSettingValue:
			response[settingName] ||
			// translators: No value found message for when a WP setting has no value.
			__('No value found', 'extendify-local'),
	};
};

```
