| 开发者 | eeeurico |
|---|---|
| 更新时间 | 2026年10月12日 18:05 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
headless-deploy-panel-for-vercel folder to /wp-content/plugins/.The deploy hook URL and an API token are required for the deployments page. Project name and team ID are optional filters. The revalidation URL is only needed for the "Revalidate page" button.
Open your team in the Vercel dashboard and go to Settings → General. You can use the team ID or the team slug.
When an editor clicks Revalidate page, WordPress sends a GET request to your revalidation URL with two query parameters:
path: the path of the post, for example /about/team/post_type: the post type, for example pagex-revalidate-secret header. Only published content can be revalidated.
For the App Router, create app/api/revalidate/route.js:
`
import { revalidatePath } from "next/cache"
export async function GET(request) {
if (request.headers.get("x-revalidate-secret") !== process.env.REVALIDATE_SECRET) {
return Response.json({ message: "Invalid secret" }, { status: 401 })
}
const path = request.nextUrl.searchParams.get("path")
if (!path) {
return Response.json({ message: "Missing path" }, { status: 400 })
}
revalidatePath(path)
return Response.json({ revalidated: true, path })
}
`
Set REVALIDATE_SECRET in your Vercel project to the same value as the plugin's "Revalidation secret" setting, then use https://your-site.com/api/revalidate as the revalidation URL.
Yes, with the headless_deploy_panel_meta_box_post_types filter:
add_filter( 'headless_deploy_panel_meta_box_post_types', function ( $post_types ) { $post_types[] = 'product'; return $post_types; } );
On GitHub. Issues and pull requests are welcome.
headless_deploy_panel_settings. Settings from earlier versions are migrated automatically.headless_deploy_panel_meta_box_post_types.x-revalidate-secret header.deploy_vercel_settings option. Settings from 1.0.x are migrated automatically.VDWP/meta_box/post_types is now deploy_vercel_meta_box_post_types.