# extendify/3.0.5/src/Shared/lib/api-fetch.js

Extendify, version 3.0.5. 15 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.0.5/code/src/Shared/lib/api-fetch.js
- Raw: https://pluginprobe.com/plugins/extendify/3.0.5/raw/src/Shared/lib/api-fetch.js
- Modified: 2025-09-15T19:30:06+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.5/code/src/Shared/lib/api-fetch.js#L10-L20`.

```javascript
import apiFetch from '@wordpress/api-fetch';

// wp/v2 or extendify/v1
const API_NAMESPACE_RE = /^(?:\/)?(?:wp|extendify)\/v\d+(?:\/|$|\?)/i;
apiFetch.use((options, next) => {
	if (!API_NAMESPACE_RE.test(options.path)) {
		return next(options);
	}

	return next({
		...options,
		headers: { ...options?.headers, 'X-Extendify': 'true' },
	});
});

```
