PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Agent / abilities / content-search.js

content-search.js in Extendify 3.2.1, at src/Agent/abilities/content-search.js

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import apiFetch from '@wordpress/api-fetch';
2 import { __ } from '@wordpress/i18n';
3
4 const path = '/extendify/v1/agent/content-search';
5
6 export const contentSearch = {
7 name: 'extendify/content-search',
8 label: __('Site text', 'extendify-local'),
9 description:
10 'Find which of this site’s posts, pages, headers, footers and patterns say something, and read the words around each match. It searches the text a visitor sees, so wording that only appears once a pattern or shortcode has run is found too. Look for a single word or a short phrase, not a sentence.',
11 inputSchema: {
12 type: 'object',
13 properties: {
14 query: {
15 type: 'string',
16 description: 'The word or short phrase to look for.',
17 },
18 postTypes: {
19 type: 'array',
20 items: { type: 'string' },
21 description:
22 'Which post types to look through. Defaults to posts, pages, template parts and patterns.',
23 },
24 limit: {
25 type: 'integer',
26 minimum: 1,
27 maximum: 25,
28 description: 'How many posts to return. Defaults to 10.',
29 },
30 context: {
31 type: 'integer',
32 minimum: 10,
33 maximum: 300,
34 description:
35 'How many characters to quote either side of a match. Defaults to 60.',
36 },
37 },
38 required: ['query'],
39 },
40 annotations: { readonly: true },
41 execute: (input = {}) => apiFetch({ path, method: 'POST', data: input }),
42 };
43