| 1 |
import { __ } from '@wordpress/i18n'; |
| 2 |
|
| 3 |
export default { |
| 4 |
id: 'publish-page', |
| 5 |
follows: [ |
| 6 |
'create-page', |
| 7 |
'edit-post-strings', |
| 8 |
'edit-post-strings-editor', |
| 9 |
'block-general', |
| 10 |
'block-patching', |
| 11 |
'select-block', |
| 12 |
], |
| 13 |
// translators: Title of a card in the AI Agent chat, shown after the user edited a page that is still a draft. |
| 14 |
title: __('Ready to publish?', 'extendify-local'), |
| 15 |
// translators: Body of a card in the AI Agent chat, shown after the user edited a page that is still a draft. |
| 16 |
body: __( |
| 17 |
'This page is still a draft. Publish it so visitors can see it.', |
| 18 |
'extendify-local', |
| 19 |
), |
| 20 |
action: { |
| 21 |
// translators: Button on a card in the AI Agent chat that opens a confirmation to publish the current page. |
| 22 |
label: __('Publish page', 'extendify-local'), |
| 23 |
workflowId: 'update-post-status', |
| 24 |
}, |
| 25 |
score: ({ context, abilities }) => |
| 26 |
abilities?.canEditPosts && |
| 27 |
!context?.adminPage && |
| 28 |
context?.postId && |
| 29 |
context?.postStatus === 'draft' |
| 30 |
? 2 |
| 31 |
: 0, |
| 32 |
}; |
| 33 |
|