WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#1517 closed enhancement (fixed)

Set new default filters for searches

Reported by: keesiemeijer Owned by: coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords: has-patch
Cc:

Description

As it is now all filters for searches are used by default on most pages. I don't know if there's any data for what filters are used most, but for my own searches I use the Functions and Hooks filters the most.
This means I have to uncheck Classes, Methods and sometimes Filters before I can do a search.

I propose we only set the Functions filter in the reference page itself and use the post type(s) used in the query for all other pages.

Attachments (3)

1517.patch (969 bytes) - added by keesiemeijer 4 years ago.
Use post type "functions" in the reference page itself and use the post types from the query on all other pages
1517.1.patch (1.5 KB) - added by keesiemeijer 4 years ago.
Set Functions as the default filter if no post types are found in the query
1517.2.patch (1.4 KB) - added by keesiemeijer 3 years ago.
No defaults used for filters

Download all attachments as: .zip

Change History (8)

@keesiemeijer
4 years ago

Use post type "functions" in the reference page itself and use the post types from the query on all other pages

@keesiemeijer
4 years ago

Set Functions as the default filter if no post types are found in the query

#1 @keesiemeijer
4 years ago

In patch 1517.1 the default checked filter for the search form is set to the Functions filter.

If post types are used in the current query the filters are checked correspondingly.
If no filters were used all post type filters are checked.

#2 @keesiemeijer
3 years ago

After thinking about it more we should not set any filters by default. This means you search in all post types if no filters were checked. This has the benefit of refining your search by checking (instead of unchecking) the filters you want. If you set any filters for a search they should be checked on the results page also (even if you check all filters).

@keesiemeijer
3 years ago

No defaults used for filters

#3 @coffee2code
3 years ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 2939:

developer.wordpress.org: Change search form behavior to default checkboxes to be unchecked.

  • When a search is performed with no checkboxes checked, search all parsed post types (same as if all checkboxes checked).
  • Makes it easier to filter search by only necessitating clicking checkbox(es) to limit search, rather than unchecking checkbox(es).

Props keesiemeijer.
Fixes #1517.

#4 @coffee2code
3 years ago

@keesiemeijer: I liked your revised approach. The only change between your patch and what I committed is that I did not default any of the post type filter checkboxes on the search form on pages other than the main search page.

I don't think it's reasonable to assume that if a visitor is looking at the docs for a specific function that if they use the slide-down search form that they necessarily are looking to search for just functions. Plus it's easy to overlook that the checkbox was automatically checked, making the search results not as comprehensive as expected.

For the search page, of course, if a visitor checked any of the post type filters and were viewing the results of the search, those filters remain checked.

#5 @keesiemeijer
3 years ago

I like this even better :)

Note: See TracTickets for help on using tickets.