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 series landing page footer using wrong global $post after the sidebar is output #1176

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Mar 18, 2016

Changes

Resets the global $post with wp_reset_postdata() after the sidebar.

Why

Widgets in the sidebar of the series landing page can mess with the global $post variable, causing the the series landing page footer to be drawn from a post that is not the series landing page. If the post mismatches, then contents of the footer are unreliable, and may not match the resired setting of non, sidebar, or custom HTML.

This doesn't affect the landing page's LMP query, because the LMP query is encoded into the page before the sidebar is output, when the LMP partial is gotten.

This doesn't account for protections to widgets in the footer, because as far as I know Largo doesn't recommend or support putting post-dependent widgets in the global footer context. Plus, post-dependent widgets wouldn't be put there.

For HELPDESK-590.

@benlk benlk added this to the hotfix milestone Mar 18, 2016
@benlk benlk assigned aschweigert and unassigned rnagle Mar 21, 2016
aschweigert added a commit that referenced this pull request Mar 21, 2016
…ostdata

Fix series landing page footer using wrong global $post after the sidebar is output
@aschweigert aschweigert merged commit dbfb738 into master Mar 21, 2016
@aschweigert aschweigert deleted the HELPDESK-590-series-landing-reset-postdata branch March 21, 2016 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants