Skip to content

Update search-filter.php - redirect fix - #35

Open
0v3rth3d4wn wants to merge 3 commits into
rmorse:masterfrom
0v3rth3d4wn:master
Open

Update search-filter.php - redirect fix#35
0v3rth3d4wn wants to merge 3 commits into
rmorse:masterfrom
0v3rth3d4wn:master

Conversation

@0v3rth3d4wn

Copy link
Copy Markdown

On line 86, you are attaching an action, which has wp_redirect, which is attached to get_header. I think the last action you should be using to redirect is "template_redirect" - I am suggesting you use "wp".
If you keep it like this you are assuming that nothing would be echoed to the screen before "get_header". I am using the Sage template, which has some code before "get_header" and throws "headers already sent" error - https://github.com/roots/sage/blob/8.5.0/base.php#L14

On line 86, you are attaching an action, which has wp_redirect, which is attached to get_header. I think the last action you should be using to redirect is "template_redirect"  - I am suggesting you use "wp". 
If you keep it like this you are assuming that nothing would be echoed to the screen before "get_header". I am using the Sage template, which has some code before "get_header" and throws "headers already sent" error - https://github.com/roots/sage/blob/8.5.0/base.php#L14
@bknightly

Copy link
Copy Markdown

My site was not redirecting to an archive page, and instead was just refreshing the page with no change. After applying the adjustment to line 86 in search-filter.php, the plugin now works as it should!

Big thanks @0v3rth3d4wn for the find. Hope this PR gets approved, or an equivalent fix is worked into the free version of this plugin once it's updated.

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.

2 participants