# extendify/3.2.3/src/Agent/follow-ups/cards/add-to-menu.js

Extendify, version 3.2.3. 30 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.3/code/src/Agent/follow-ups/cards/add-to-menu.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.3/raw/src/Agent/follow-ups/cards/add-to-menu.js
- Modified: 2026-10-08T17:02:48+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.2.3/code/src/Agent/follow-ups/cards/add-to-menu.js#L10-L20`.

```javascript
import { __ } from '@wordpress/i18n';

export default {
	id: 'add-to-menu',
	follows: ['update-post-status'],
	// translators: Title of a card in the AI Agent chat, shown after the user published a page or post.
	title: __('Add it to your menu', 'extendify-local'),
	// translators: Body of a card in the AI Agent chat, shown after the user published a page or post.
	body: __(
		'Now that it is published, add it to your site menu so visitors can find it.',
		'extendify-local',
	),
	action: {
		// translators: Button on a card in the AI Agent chat that asks the agent to add the published page or post to the site menu.
		label: __('Add to menu', 'extendify-local'),
		// select-block has no example, so find-agent routes this message.
		// translators: Shown in the AI Agent chat as the user's own request, sent when they click the "Add to menu" button.
		message: __('Add this to the menu', 'extendify-local'),
	},
	// Picked after the confirm's reload, so the context holds the saved status.
	score: ({ context }) => (context?.postStatus === 'publish' ? 1 : 0),
	toolContext: () => {
		const { postId, postTitle } = window.extAgentData?.context ?? {};
		return {
			refersTo: { postId, postTitle },
			nextStep: 'Add this page to the menu',
		};
	},
};

```
