apermo/classic-to-gutenberg
Composer 安装命令:
composer require apermo/classic-to-gutenberg
包简介
Batch migration from classic editor content to Gutenberg blocks.
README 文档
README
Batch migration of WordPress classic editor content to Gutenberg blocks.
Requirements
- PHP 8.2+
- WordPress 6.2+
- Composer
Installation
This plugin uses Composer for autoloading. You must run composer install before activating:
composer install
If dependencies are missing, the plugin displays an admin notice and does not load.
Usage
WP-CLI
# Show how many classic posts need conversion wp classic-to-gutenberg status # Preview conversion without saving wp classic-to-gutenberg convert --dry-run # Convert all classic posts wp classic-to-gutenberg convert # Convert specific post types wp classic-to-gutenberg convert --post-type=post,page # Detect unparseable content before converting wp classic-to-gutenberg detect wp classic-to-gutenberg detect --format=csv # Rollback a converted post wp classic-to-gutenberg rollback 42
Admin Row Actions
On the Posts/Pages list screen, classic posts (without block markup) show two additional row actions:
- Convert to Blocks — converts the post content and saves immediately
- Preview Blocks — shows a preview of the converted block markup without saving
Supported Conversions
| Classic HTML | Gutenberg Block |
|---|---|
<p> |
core/paragraph |
<h1>–<h6> |
core/heading |
<ul>, <ol> |
core/list with core/list-item |
<blockquote> |
core/quote with inner core/paragraph |
<table> |
core/table (requires <thead> + <tbody>) |
<img> |
core/image (standalone, linked, or in <figure>) |
<pre> |
core/preformatted |
<hr> |
core/separator |
<!--more--> |
core/more |
<!--nextpage--> |
core/nextpage |
[caption] |
core/image with caption |
[gallery] |
core/gallery with inner core/image |
| Other shortcodes | core/shortcode |
| Unrecognized HTML | core/html (fallback) |
Hooks
Filters
classic_to_gutenberg_converters— register custom block convertersclassic_to_gutenberg_pre_convert— filter content before conversionclassic_to_gutenberg_post_convert— filter content after conversionclassic_to_gutenberg_finder_args— filter post finder query argumentsclassic_to_gutenberg_shortcode_handlers— extend shortcode handler registry
Actions
classic_to_gutenberg_post_converted— fired after each post conversionclassic_to_gutenberg_post_rolled_back— fired after rollbackclassic_to_gutenberg_batch_started— fired before batch conversionclassic_to_gutenberg_batch_completed— fired after batch conversion
Development
composer cs # Run PHPCS composer cs:fix # Fix PHPCS violations composer analyse # Run PHPStan composer test # Run all tests composer test:unit # Run unit tests only composer test:integration # Run integration tests only
Local WordPress Environment
ddev start && ddev orchestrate
Git Hooks
Enable the pre-commit hook (PHPCS + PHPStan on staged files):
git config core.hooksPath .githooks
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Acknowledgements
Development of this plugin is supported by
License
apermo/classic-to-gutenberg 适用场景与选型建议
apermo/classic-to-gutenberg 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 656 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「migration」 「blocks」 「gutenberg」 「classic-editor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 apermo/classic-to-gutenberg 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 apermo/classic-to-gutenberg 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 apermo/classic-to-gutenberg 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Blocks for NetCommons Plugin
A block that displays featured content - large image, title, description and link.
Flexslider slideshow content block for Silverstripe Elemental
A block to display a list of links to child pages, or pages in current level
Collection of useful and reusable SilverStripe Elemental stylings properties
Silverstripe content blocks module
统计信息
- 总下载量: 656
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-03-15