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

Allow users to filter the number of results per page in Instant Results #3292

Merged
merged 5 commits into from
Feb 8, 2023

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Feb 2, 2023

Description of the Change

This PR does two things:

  1. Sets the default number of results per page in Instant Results to match the number of posts per page as set in Settings > Reading. This is configured as the default value for a feature setting so that a UI could be supported in future.
  2. Adds an ep_instant_results_per_page filter so developers can change the number of results per page in Instant Results.

Also included are a test for both of the above pieces of functionality and a section in the theme integration docs on using the filter.

Closes #3274

How to test the Change

  1. Activate Instant Results and perform a search. The number of results should match the number of posts per page as set in Settings > Reading.
  2. Add code like add_filter( 'ep_instant_results_per_page', function() { return 3; } ); and verify that the number of results per page matches the filtered value.

Changelog Entry

Added - An ep_instant_results_per_page filter for changing the number of results per page in Instant Results.
Changed - The number of results per page in Instant Results now matches the site's posts per page setting.

Credits

Props @JakePT

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@felipeelia felipeelia added this to the 4.5.0 milestone Feb 2, 2023
@felipeelia
Copy link
Member

@JakePT we have an e2e test that is consistently failing on this one. Did you have the chance to give a look into it?

@felipeelia felipeelia merged commit 0af7fe3 into develop Feb 8, 2023
@felipeelia felipeelia deleted the feature/3274 branch February 8, 2023 11:05
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.

How can I increase the results count for Instant Results?
2 participants