-
Notifications
You must be signed in to change notification settings - Fork 799
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
Instant Search: Account for site URL when appending query string #13846
Conversation
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: November 5, 2019. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well in almost all cases that I tested (tested on my subdirectory install of WP). The only case I found was when using the back button it didn't reload the original page. For instance, load the homepage and then do a single filter, click back, and although the url gets correctly updated the search results do not get cleared.
We could potentially break this out into a separate issue if it is tough to fix, it is a pretty minor corner case.
Updated to use home_url()
instead of site_url()
This should be fixed now; I added handling for popstate events, which are triggered by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merging.
Fixes #13845.
Changes proposed in this Pull Request:
site_url()
to Instant Search's front-end application.Testing instructions:
Testing on a WordPress installation at a root URL (e.g.
/
):/?s=hello
)Testing on a WordPress installation at a non-root URL (e.g.
/wp-blog
):/wp-blog/?s=hello
)Setting up Jetpack Search:
Add
define( "JETPACK_SEARCH_PROTOTYPE", true );
to your wp-config.php.If using Jetpack's Docker development environment, you can create a file at
/docker/mu-plugins/instant-search.php
and add the define there.Ensure that your site has the Jetpack Pro plan and Jetpack Search enabled.
You can enable Jetpack Search in the Performance tab within the Jetpack menu (
/wp-admin/admin.php?page=jetpack#/performance
).Select a theme of your choosing and add a Jetpack Search widget to the site via the customizer, preferably with some filters enabled. If you're using a theme with a sidebar widget area, please add the Jetpack Search widget there.
Proposed changelog entry for your changes: