Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Ensure that preview urls are used as permalinks for customized posts #245

Merged
merged 5 commits into from
Sep 4, 2016

Conversation

westonruter
Copy link
Contributor

This fixes an issue in snapshots frontend preview where auto-draft posts previewed as published would get erroneously redirected from the preview URL to instead have a URL like /-0001/11/30/ since the date is 0000-00-00 and the post_name is empty. This URL would then redirect to the homepage.

This also ensures that WordPress will be able to locate the customized post since the post_name may have been changed.

This PR also adds (for good measure) a validate_file() to the results of a glob(), and adds sanitize_text_field() for the input of post searching.

This fixes an issue in snapshots frontend preview where auto-draft posts previewed as published would get erroneously redirected from the preview URL to instead have a URL like /-0001/11/30/ since the date is 0000-00-00 and the post_name is empty. This URL would then redirect to the homepage.

This also ensures that WordPress will be able to locate the customized post since the post_name may have been changed.
@westonruter westonruter added this to the 0.8.0 milestone Sep 4, 2016
@westonruter westonruter merged commit 17e3cd2 into develop Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant