# extendify/3.0.6/src/Agent/workflows/content/tools/get-post-status.js

Extendify, version 3.0.6. 14 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.0.6/code/src/Agent/workflows/content/tools/get-post-status.js
- Raw: https://pluginprobe.com/plugins/extendify/3.0.6/raw/src/Agent/workflows/content/tools/get-post-status.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.0.6/code/src/Agent/workflows/content/tools/get-post-status.js#L10-L20`.

```javascript
import apiFetch from '@wordpress/api-fetch';

const postTypes = { page: 'pages', post: 'posts' };

// status should only be either "publish" or "draft"
export default async ({ postId, postType }) => {
	const type = postTypes[postType] || postType;
	const response = await apiFetch({
		path: `/wp/v2/${type}/${postId}?context=view`,
	});

	return { post_status: response.status };
};

```
