Last active
July 25, 2019 19:06
-
-
Save daliborgogic/fdec6f1820df031bc9d51ca8e63c06f4 to your computer and use it in GitHub Desktop.
Headless WordpPress REST API Change post preview button url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function pwa_preview_link() { | |
| $slug = basename(get_permalink()); | |
| $pwadomain = 'https:/example.com'; | |
| $pwadir = '/'; | |
| $pwaurl = "$pwadomain$pwadir$slug"; | |
| return "$pwaurl"; | |
| } | |
| add_filter('preview_post_link', 'pwa_preview_link'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment