Fix the purge caching issue when the post status is changed to draft or pending #174
I have fixed the purge caching issue when the post status is changed to draft or pending.
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.
The text was updated successfully, but these errors were encountered:
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.