Skip to content
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

Fix Purge Cache menu caching issue in the front-end #173

Merged
merged 5 commits into from
Feb 25, 2019

Conversation

imranhsayed
Copy link
Contributor

I have fixed the Purge Cache menu caching issue in front-end.
I have changed the name of Purge Cache menu button in the front to 'Purge Current Page'
When the 'Purge Current Page' menu button on the front end is now clicked, it only clears the page cache.

Fixes #171

… value on front-end admin bar.

Conditionally display the purge cache button name as 'Purge Cache' for admin dashboard and 'Purge Current Page' on front-end admin bar.
Conditionally set query argument 'nginx_helper_urls' value to 'all' for admin dashaboard purge cache button and 'current-url' for front-end admin bar button
Change hook from 'admin_init' to 'admin_bar_init' so that purge_all() is called when purge button is clicked on both admin dashboard and front end admin bar.
Check if the user is on front end when set the call purge_url() and purge the current page cache on case basis.
Copy link
Member

@mrrobot47 mrrobot47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the PR. Working as described in the description.

admin/class-nginx-helper-admin.php Outdated Show resolved Hide resolved
admin/class-nginx-helper-admin.php Outdated Show resolved Hide resolved
Put the correct value for the 'meta key' of add_menu() and remove escaping from purge_url() on line 688 as already escaped at the end
@chandrapatel chandrapatel merged commit 377c2c1 into rtCamp:master Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin Bar Purge Cache in Front-End Not Working
3 participants