Making WordPress.org

Opened 10 years ago

Closed 10 years ago

#686 closed defect (bug) (fixed)

Searching functions with parenthesis returns no results for valid funtion names

Reported by: blobaugh's profile blobaugh Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords:
Cc:

Description

When using the code reference search form at https://developer.wordpress.org/reference/ for functions by name with and without the parenthesis changes the results.

For example, searching for 'sanitize_text_field()' will return zero results
https://developer.wordpress.org/?s=sanitize_text_field%28%29&post_type[]=wp-parser-function&post_type[]=wp-parser-hook&post_type[]=wp-parser-class&post_type[]=wp-parser-method

While searching for 'sanitize_text_field' returns multiple results
https://developer.wordpress.org/?s=sanitize_text_field&post_type[]=wp-parser-function&post_type[]=wp-parser-hook&post_type[]=wp-parser-class&post_type[]=wp-parser-method

Searching with the () should return the function and searching without () should return both the function and the hook.

Change History (2)

This ticket was mentioned in Slack in #docs by blobaugh. View the logs.


10 years ago

#2 @coffee2code
10 years ago

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

In 951:

Code Reference: presume an exact match search request for a function or method if search term ends with '()'. Fixes #686

Falls back to general search if no exact match found.

Note: See TracTickets for help on using tickets.