Rehydrator WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
Pattern-based content transformation for WordPress block migrations.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/humanmade/rehydrator/archive/refs/heads/main.zipOn Packagist as humanmade/rehydrator:
composer require humanmade/rehydratorPattern-based content transformation for WordPress block migrations. Provides utilities for loading block patterns, resolving nested pattern references, and applying targeted transformations to populate templates with content.
Installation
Via Composer:
composer require humanmade/rehydrator
As a WordPress plugin: Clone or download this repository to wp-content/plugins/ and activate.
Requirements
- PHP 8.0+
- WordPress 6.0+
Quick Start
use HM\Rehydrator\Template;
$transformer = new Template( 'theme/template-article' );
$content = $transformer
->replace_text( 'theme/hero', 'core/heading', occurrence: 0, text: $title )
->replace_text( 'theme/hero', 'core/paragraph', occurrence: 0, text: $standfirst )
->replace_attributes( 'theme/hero', 'core/image', occurrence: 0, attrs: [
'id' => $image_id,
'url' => $image_url,
] )
->replace_placeholder( 'content-placeholder', $body_blocks )
->get_content();
wp_update_post( [
'ID' => $post_id,
'post_content' => $content,
] );
For full API documentation including all transformation methods and helper namespaces, see the docs site.
Development
Running Tests
composer install
composer test
Code Style
composer lint
License
GPL-2.0-or-later
Releases
8 releases.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.