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 the purge caching issue when the post status is changed to draft or pending #174



Copy link

@imranhsayed imranhsayed commented Feb 20, 2019

I have fixed the purge caching issue when the post status is changed to draft or pending.
I have used get_sample_permalink() to fix this issue because the get_permalink() returns URL something like and we need full permalink something like

The get_permalink() function returns full permalink for the published post only. I explored WordPress codebase and found get_sample_permalink() which returns an array containing the sample permalink with a placeholder for the post name, and the post name.

Fixes #170

Get the permalink using get_sample_permalink() on post status other than publish. Use get_permalink() when post status is publish.
The reason why we use get_sample_permalink(0, because get_permalink() does not return pretty permalink for draft or pending posts.
Copy link

@mrrobot47 mrrobot47 left a comment

Tested the PR. Working as described in the description.

@chandrapatel chandrapatel merged commit fccd54d into rtCamp:master Feb 25, 2019
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants