WordPress Refresh on Update

1
2
<script>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Initially this was to be used with the Rest API plugin but Rest is native now with WP so you don't need the plugin anymore.

3 Responses

How does it work?
@God is good The code above uses the REST API plugin as sort of a heart beat. So you would add the code to your index.php, or page.php for example. When you publish or when you update the page the clients computer will automatically refresh.
@God is good Sorry I'm wrong about that you don't need the first part, that's for something else. So I deleted that. You only need the one script currently above. It polls the site every three seconds. When it sees a change it will automatically refresh the client machine with the new changes.

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.