gregrickaby/nextjs-wordpress

On-demand Revalidation

gregrickaby opened this issue · 1 comments

The on-demand revalidation in the nextjs-wordpress-plugin could use some work. When a user clicks "update" it sends several requests back to Vercel, instead of just 1.

I believe this should be as simple as using wp_transition_post_status() instead of the edit_post hook.

https://developer.wordpress.org/reference/functions/wp_transition_post_status/

https://github.com/gregrickaby/nextjs-wordpress/blob/main/packages/nextjs-wordpress-plugin/inc/revalidation.php#L70

This was fixed, forgot to close.