=== BlockCode Exporter ===
Contributors: georgelz
Tags: block editor, gutenberg, block code, content export, bulk export
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Export WordPress block markup from post lists or the editor. Download an .html file, copy the code, or export several items in a ZIP.

== Description ==

BlockCode Exporter saves the block markup behind a WordPress post or page. A list export downloads the saved source unchanged, including block comments, settings, HTML, and whitespace.

Use Export block code in a Posts or Pages list to download the saved version. In the block editor, open the three-dot Options menu and choose Export block code to download what is currently in the editor, including unsaved changes. You can also copy the code to your clipboard.

For several posts or pages, select them in the list and choose Export block code from Bulk actions. The download is a ZIP with a separate file for each item.

Files use `.html` by default because WordPress block markup contains HTML. You can choose `.md` or `.txt` if those extensions suit your workflow. The content is the same in every format: choosing `.md` does not convert it to Markdown, and `.html` is not a complete rendered web page.

The plugin does not change your posts or send their content to another service. Exports include the block markup, not media files, theme styles, custom fields, or the content behind a synced-block reference.

Developed by George Zamfir.

== Installation ==

1. In WordPress, go to Plugins > Add New > Upload Plugin and select the BlockCode Exporter ZIP.
2. Install and activate the plugin.
3. Open Posts or Pages and choose Export block code beneath an item, or open a post in the block editor and use its three-dot Options menu.

You need WordPress 6.6 or later and PHP 8.2 or later.

== Frequently Asked Questions ==

= What is in the downloaded file? =

The file contains WordPress block markup, including block comments and HTML. It is not a rendered page. Open it in a text or code editor to inspect the source.

= What is the difference between exporting from a list and from the editor? =

The list action downloads the content last saved in WordPress. The editor action uses the content currently open in the editor, so it can include changes you have not saved yet. Bulk exports also use saved content.

= Does the .md option create Markdown? =

No. `.html`, `.md`, and `.txt` contain the same WordPress block markup. Only the filename extension changes.

= Can I use the file on another WordPress site? =

You can paste the markup into the Code editor of another post or page. Check the result before saving: the destination site may use different blocks, styles, media URLs, or synced-block IDs. Those dependencies are not included in the file.

= Which posts can I export? =

Posts, pages, and supported custom post types are available when your account can edit the individual item. This includes drafts and private content you can edit. Attachments, revisions, and navigation items are excluded. A bulk export stops if the selection contains an item you cannot export.

= Does the plugin keep a copy of my exports? =

No. Downloads are sent to your browser. The plugin does not save an export history, change the original post, or contact an external service.

== Screenshots ==

1. Export block code in the Pages list, alongside the usual row actions.
2. Choose a filename and file format, then download the saved block markup or copy it.
3. Export several selected pages as separate files in one ZIP.
4. The same export dialog in the block editor uses the current content, including unsaved changes.
5. WordPress confirms when the current editor content has been copied to the clipboard.

== Developer notes ==

List exports return the saved `post_content` unchanged unless a site uses the `blockcode_exporter_content` filter. Editor exports use the current block editor content and do not run that PHP filter. The `blockcode_exporter_filename` and `blockcode_exporter_is_post_type_enabled` filters apply to list exports. Filenames are sanitized after filtering, and list requests still require permission to edit each item.

Bulk exports are limited to 100 items and 20 MiB of source per request. ZIP filenames include post IDs to avoid collisions.

The GPL-licensed source and build instructions are included in the installation ZIP.

== Changelog ==

= 1.1.0 =
* Add an export dialog with filename, format, download, and clipboard options.
* Use `.html` as the default extension; `.md` and `.txt` remain available.
* Export current content, including unsaved changes, from the block editor.
* Export several saved posts or pages as a ZIP from Bulk actions.
* Add interface translations for ten WordPress locales.

= 1.0.0 =
* First public release: download saved block markup from posts, pages, and supported custom post types.
