WIP: Experiment: Advanced search qualifiers#87
WIP: Experiment: Advanced search qualifiers#87StevenDufresne wants to merge 14 commits intotrunkfrom
Conversation
| if ( str_contains( $s, '(' ) ) { | ||
| // Modify the search query to omit the parentheses. | ||
| $keyword = rtrim( $keyword, '()' ); |
There was a problem hiding this comment.
Oh.. Well this breaks some of this code :D
I guess I should've done this instead, @StevenDufresne does my change look proper this time?
| if ( str_contains( $s, '(' ) ) { | |
| // Modify the search query to omit the parentheses. | |
| $keyword = rtrim( $keyword, '()' ); | |
| if ( str_contains( $s, '(' ) ) { | |
| // Modify the search query to omit the parentheses. | |
| $keyword = str_replace( array( '()', '(' ), '', $keyword ); |
There was a problem hiding this comment.
I've updated the code to use the str_replace again. It appears to work. 👍
c671123 to
3d2c2f4
Compare
|
I think this works well, the only problem I don't have a solution for is that the search query and the filter boxes can fall out of sync seeing that we don't automatically append the advanced search qualifiers when using the filter boxes. For example:
It will apply the filter but the search keyword will still be I don't think we want to add/remove to the searchbox everytime a checkbox is clicked though... 🤔 |
Mentioned in: meta:3158.
Allow some basic search qualifiers to make searching a little bit more powerful.
Filter by type:
You can combine multiple types to filter.
type:hooktype:functiontype:methodtype:classFilter by file:
You can filter within 1 or more files. Will match partial paths. Uses
name__like.file:wp-settings.phpFilter by version:
You can filter within 1 version. Must be a full version.
version:4.8.0Examples:
Search:
version:4.8.0 file:class-wp-editor.php getSee version
4.8.0, file:class-wp-editor.php, looking for functions that havegetin them.Returns: