Add force refresh button on page
-
Is it possible to place a button on a page that will function like the refresh button on the admin bar?
-
Thanks for reaching out! Just to be clear, are you asking if it’s possible for a visitor of a site to initiate a force refresh for all users without being logged in?
Is was looking for at function to place it on a page the a editor has to be logged in to view. Is it will not be publich.
I believe the feature you’re describing already exists, which is the ability to refresh a page from either the menu bar or the publish meta box in a page. Since you’re describing an ability to refresh a specific page that is not visible to the user, this would take place on the admin section, either in the menu bar or publish meta box.
okay thanks. The reason for this is that I have a page where the editor can update a form entry and then the public page must refresh when the editor is done. I would like this to work on the page without having the editor going to the main page or the force refresh page. I tried to grab the code from the refresh buttton and load it in a code area on a page. the button does work but the public page does not reload
Copying and pasting the button HTML into a separate area is not a supported feature since that would open up many security issues. However, you’d be able to initiate a refresh via the menu bar which is a supported feature.
yes but the refresh button is not visible when you view the page. only if I edit the page. can this be changed?
You can initiate it from the admin bar, which appears on any page as long as you’re signed in.
hmm strange. when I am logged in and viewing the page i get the admin bar but the force refresh button is not showing.
Do you have “Refresh from Admin Bar” set to “Show” under wp-admin/tools.php?page=force_refresh?
Yes and it does show when i edit the page but not when I view the page
Ah, yeah it does not appear to show up in if you’re outside of the editor. I can add this to the list of features to include in the future.
Is it possible to create a link that could run the refresh script? os I could place this on another page.
That not currently a supported feature since that would open up many security issues.
that is true.Can it help if the page is only visible when the user is logged in and has admin rights?
In this case, no. The nonce is generated at an admin level and isn’t assigned by the page. That’s why admin functions are generally limited to admin pages and not inside of pages exposed to users.
The topic ‘Add force refresh button on page’ is closed to new replies.