-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WP 5.2: Change preview link or rewrite PostPreviewButton component #15895
Comments
@demo-igor If it helps, the link that's used by
I'm not sure if there are ways to intercept those properties on the post objects, but that might be the most promising route to investigate. |
@talldan the main problem to me that WP used the same API on many places and I don't want to change the API globally. I just would like to change preview link for PostPreviewButton only, like I did with WP php hooks for another places. |
@youknowriad could you help to understand is it possible to replace link for PostPreviewButton or maybe is it possible to updated those methods: |
Closing as a duplicate of #13998. |
I'd like to consider reopening this as I think it's slightly distinct from #13998. In my particular case, simply rewriting the preview link isn't enough — that gets a small part of the job done, but you are still unable to overwrite a lot of the behavior around how Gutenberg handles autosaving and preview generation. In my case, I'm working within an architecture where our front-end is completely decoupled from WordPress and from the WP API (two levels of headless!) where previews need to actually trigger a POST event with data from another database to work properly. In my case, it would be much easier to be able to filter the button entirely, or completely disable it and provide my own alternative. As of now, I'm not able to find a great way to do that, short of using CSS, which feels frustratingly hacky in this declarative Gutenberg world. |
@chrisvanpatten have you solved the problem? Thank you |
WP 5.2
I would like to ask is it possible to update preview link for preview button on post edit page? I have a custom preview link and I'm able to update link related to php with add_action and add_filter but I' didn't find any way to update preview link to PostPreviewButton.
Maybe there is possible to rewrite PostPreviewButton component?
The text was updated successfully, but these errors were encountered: