# extendify/3.1.6/src/Agent/workflows/theme/add-post-to-menu.js

Extendify, version 3.1.6. 19 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.6/code/src/Agent/workflows/theme/add-post-to-menu.js
- Raw: https://pluginprobe.com/plugins/extendify/3.1.6/raw/src/Agent/workflows/theme/add-post-to-menu.js
- Modified: 2025-10-23T16:20:58+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.6/code/src/Agent/workflows/theme/add-post-to-menu.js#L10-L20`.

```javascript
import { UpdateMenuConfirm } from '@agent/workflows/theme/components/UpdateMenuConfirm';

const { abilities, context } = window.extAgentData;

const hasNavMenu = () =>
	window.document.querySelectorAll('nav[data-extendify-menu-id]').length > 0;

export default {
	available: () =>
		abilities?.canEditPost &&
		context?.usingBlockEditor &&
		!context?.adminPage &&
		['post', 'page'].includes(context.postType) &&
		hasNavMenu() &&
		context?.postId,
	id: 'add-post-to-menu',
	whenFinished: { component: UpdateMenuConfirm },
};

```
