# extendify/3.1.3/src/QuickEdit/lib/link-suggestions.js

Extendify, version 3.1.3. 23 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.3/code/src/QuickEdit/lib/link-suggestions.js
- Raw: https://pluginprobe.com/plugins/extendify/3.1.3/raw/src/QuickEdit/lib/link-suggestions.js
- Modified: 2026-06-11T18:37:12+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.3/code/src/QuickEdit/lib/link-suggestions.js#L10-L20`.

```javascript
// BlockEditorProvider's sub-registry doesn't inherit core's default
// __experimentalFetchLinkSuggestions; pass this in via settings or the
// LinkControl falls back to treating the search term as a literal URL.
import apiFetch from '@wordpress/api-fetch';

export function fetchLinkSuggestions(search, opts = {}) {
	const params = new URLSearchParams();
	params.set('search', search || '');
	params.set('per_page', String(opts.perPage || 10));
	if (opts.type) params.set('type', opts.type);
	if (opts.subtype) params.set('subtype', opts.subtype);
	return apiFetch({ path: `/wp/v2/search?${params.toString()}` }).then(
		(results) =>
			(results || []).map((r) => ({
				id: r.id,
				url: r.url,
				title: r.title || r.url,
				type: r.subtype || r.type,
				kind: r.type,
			})),
	);
}

```
