filters - How to prepare WordPress Rest data for Preview Changes?

admin2025-06-02  1

I am currently building a custom theme by using WordPress Rest API, ACF and Vuejs.

I am able to delete some data for published pages/posts using rest_prepare_page filter and rest_prepare_post filter. But when I try to preview a page or a post, those two filters don't seem to work. This results in that the preview page will have more data from an actual published page since those data are not deleted in the preview page.

Are there any filters like rest_prepare_post_preview or rest_prepare_page_preview? So I can run my custom filter function to delete data for a preview page as well.

Cheers

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748861964a314336.html

最新回复(0)