# extendify/3.1.4/src/Agent/workflows/block-selector/tools/get-block-content.js

Extendify, version 3.1.4. 13 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.4/code/src/Agent/workflows/block-selector/tools/get-block-content.js
- Raw: https://pluginprobe.com/plugins/extendify/3.1.4/raw/src/Agent/workflows/block-selector/tools/get-block-content.js
- Modified: 2026-06-11T18:37:12+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.4/code/src/Agent/workflows/block-selector/tools/get-block-content.js#L10-L20`.

```javascript
import { useQuickEditStore } from '@quick-edit/state/store';
import apiFetch from '@wordpress/api-fetch';

export default async () => {
	const block = useQuickEditStore.getState().agentBlock;
	if (!block?.id) return { previousContent: '' };
	const { postId } = window.extAgentData.context;
	const response = await apiFetch({
		path: `/extendify/v1/agent/get-block-code?postId=${postId}&blockId=${block.id}`,
	});
	return { previousContent: response?.block ?? '' };
};

```
