NextWP Headless Toolkit
An essential WordPress plugin for building headless WordPress sites using Next.js.
It complements the @nextwp/core
package by adding enhanced features and functionalities to streamline the development process.
Features
- CMS Preview: Preview headless site content directly in the WP admin.
- Decapitate WP: Removes WordPress's built-in frontend, focusing on headless CMS capabilities.
- Flexible Content Modules: Automatically creates and manages content modules for dynamic content structuring.
- Additional Menu Locations: Allows for the addition of extra menu locations for improved site navigation.
- REST Endpoints: Adds specific REST endpoints for ACF options pages and integrates ACF data into menu items for efficient data handling.
This plugin is designed to optimize your workflow, making it easier and more efficient to create feature-rich headless WordPress sites with Next.js and NextWP.
Endpoints
NextWP Toolkit adds the following REST endpoints to your WordPress site.
These endpoints are used by the functions in @nextwp/core
when retrieving certain data from WordPress that is not available by default in the WP REST API, such as ACF options pages.
Retrieve an ACF options page
This endpoint allows you to retrieve a specific ACF options page by its slug.
@nextwp/core
provides a getOptionsPage
function that uses this endpoint to retrieve the data for an options page.
Request
const res = await fetch('/wp-json/nextwp/v1/options/my-options-page')
const data = await res.json()