Preview WordPress content on Front-end sites including Next.js
This package is auto-updated.
Last update: 2023-11-20 19:30:48 UTC
Preview headless WordPress content on your front-end site.
This plugin intends to provide a single home for preview on a variety of decoupled front-ends.
- Preview while editing a Post/Page.
- Configure multiple preview sites.
- Specify the post types (Post and Pages) that each preview site applies to.
In the WordPress Admin Dashboard, navigate to Settings -> Preview Sites (
one or more preview sites, and configure the following:
- Label: The name of the site.
- URL: The URL of the decoupled site you are providing preview data to.
- Secret: A token that will be passed to your decoupled site used to limit access to the preview.
- Preview Type: The type of preview site - currently only NextJS is supported.
- Content Types: The post types (like Post and Page) that this preview site applies to.
While we hope to expand in the future, the initial release of this plugin only supports NextJS. It was developed in support of Pantheon's Next WordPress Starter, but can be applied to other NextJS sites using a similar approach.
- Currently this plugin does not support custom post types.
- Currently this plugin does not support the classic editor.
This plugin uses Composer to manage dependencies. To install dependencies, run
composer install from the plugin directory.
Unit tests are written with PHPUnit using the WP Unit test framework. To set up your local maching to be able to run the unit tests, use the following command:
Note that you will need to have MariaDB or MySQL installed and running on your local machine. Once you have the test environment set up, you can run the unit tests with the following command:
Both linting and testing are done in a GitHub Action on every commit and pull request. Tests are located in the