From 9fbdbb60a4acf7573e4c20ea8a95bd937ae37483 Mon Sep 17 00:00:00 2001 From: ahuseyn Date: Thu, 27 Nov 2025 13:43:20 +0100 Subject: [PATCH 1/4] update readme.txt and README.md --- plugins/hwp-previews/README.md | 128 +++++--------------------------- plugins/hwp-previews/readme.txt | 95 +++++++++++++++++++++++- 2 files changed, 110 insertions(+), 113 deletions(-) diff --git a/plugins/hwp-previews/README.md b/plugins/hwp-previews/README.md index c70113e5..f83f55b5 100644 --- a/plugins/hwp-previews/README.md +++ b/plugins/hwp-previews/README.md @@ -3,7 +3,7 @@ **Headless Previews** solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. * [Join the Headless WordPress community on Discord.](https://discord.gg/headless-wordpress-836253505944813629) -* [Documentation](#getting-started) +* [Documentation](../../docs/plugins/hwp-previews/) ----- @@ -25,17 +25,6 @@ ----- -## Table of Contents - -- [Overview](#overview) -- [Features](#features) -- [Getting Started](#getting-started) -- [Configuration](#configuration) -- [Front-End Integration](#front-end-integration) -- [Using With Faust.js](#using-with-faustjs) -- [Extending the Functionality](#extending-the-functionality) -- [Testing](#testing) - ## Overview HWP Previews is a robust and extensible WordPress plugin that centralizes all preview configurations into a user-friendly settings interface. @@ -56,116 +45,34 @@ This fundamental architectural shift creates what we call the "preview problem" - **Faust Compatibility**: The plugin is compatible with [Faust.js](https://faustjs.org/) and the [FaustWP plugin](https://github.com/wpengine/faustjs/tree/canary/plugins/faustwp). ->[!IMPORTANT] +>[!NOTE] > For Faust users, HWP Previews integrates seamlessly, automatically configuring settings to match Faust's preview system. This allows you to maintain your existing preview workflow without additional setup. -## Getting Started - -This guide will help you set up your first headless preview link for the "Posts" post type. - -1. **Activate the Plugin:** Ensure "HWP Previews" is installed and activated. -2. **Navigate to Settings:** Go to **Settings > HWP Previews** in your WordPress admin dashboard. -3. **Enable for Posts:** On the "Posts" tab, check the "Enable HWP Previews" box. If you have Faust installed, this option will be enabled by default. Find more information about Faust integration below. -4. **Set the Preview URL:** In the "Preview URL Template" field for Posts, enter the URL for your front-end application's preview endpoint. Use parameters to add dynamic information that you want to access. -5. **Save and Test:** Save changes, go to any post, make a change, and click the "Preview" button. You should be redirected to the URL you just configured. - ---- - -## Project Structure - -```text -hwp-previews/ -├── src/ # Main plugin source code -│ ├── Admin/ # Admin settings, menu, and settings page logic -│ ├── Hooks/ # WordPress hooks and filters -│ ├── Integration/ # Integrations (e.g. Faust) -│ ├── Preview/ # Preview URL logic, template resolver, helpers -│ ├── Plugin.php # Main plugin class (entry point) -│ └── Autoload.php # PSR-4 autoloader -├── examples/ # Example front-end integrations for WP GraphQL and REST -├── tests/ # All test suites -│ ├── wpunit/ # WPBrowser/Codeception unit -├── hwp-previews.php -├── activation.php -├── composer.json -├── deactivation.php -├── ACTIONS_AND_FILTERS.md -├── TESTING.md -├── README.md -``` - -## Configuration - -HWP Previews configuration located at **Settings > HWP Previews** page in your WP Admin. The settings are organized by post type. - -### Settings - -For each public post type, you can configure: - -- **Enable HWP Previews:** This is the master switch for the post type. If disabled, WordPress will revert to its default preview behavior for these posts. -- **Allow All Statuses as Parent:** This option is only available for hierarchical post types like Pages. By default, WordPress only allows published posts to be parents. Enable this to build parent-child relationships using draft or pending posts. -- **Load Previews in Iframe:** When enabled, the preview will be displayed directly within the WordPress editor in a sandboxed `