| 1 |
import { __ } from '@wordpress/i18n'; |
| 2 |
|
| 3 |
export default { |
| 4 |
id: 'add-to-menu', |
| 5 |
follows: ['update-post-status'], |
| 6 |
// translators: Title of a card in the AI Agent chat, shown after the user published a page or post. |
| 7 |
title: __('Add it to your menu', 'extendify-local'), |
| 8 |
// translators: Body of a card in the AI Agent chat, shown after the user published a page or post. |
| 9 |
body: __( |
| 10 |
'Now that it is published, add it to your site menu so visitors can find it.', |
| 11 |
'extendify-local', |
| 12 |
), |
| 13 |
action: { |
| 14 |
// 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. |
| 15 |
label: __('Add to menu', 'extendify-local'), |
| 16 |
// select-block has no example, so find-agent routes this message. |
| 17 |
// translators: Shown in the AI Agent chat as the user's own request, sent when they click the "Add to menu" button. |
| 18 |
message: __('Add this to the menu', 'extendify-local'), |
| 19 |
}, |
| 20 |
// Picked after the confirm's reload, so the context holds the saved status. |
| 21 |
score: ({ context }) => (context?.postStatus === 'publish' ? 1 : 0), |
| 22 |
toolContext: () => { |
| 23 |
const { postId, postTitle } = window.extAgentData?.context ?? {}; |
| 24 |
return { |
| 25 |
refersTo: { postId, postTitle }, |
| 26 |
nextStep: 'Add this page to the menu', |
| 27 |
}; |
| 28 |
}, |
| 29 |
}; |
| 30 |
|