WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#32903 new enhancement

Url request order of priority - why "search" 3rd, after category, tag but before author, date, post etc?

Reported by: luciandavidescu Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.2
Component: Permalinks Keywords: dev-feedback
Focuses: Cc:
PR Number:

Description

I'm not too good at hooking into internal WP function, neither do I know if this particular hook could even be done (no documentation as far as I was able to search). I have this (http://stackoverflow.com/questions/31170657/redirecting-404-to-search-with-pagination-on-404-template/) situation where I need that the URL request be parsed into a search after anything else was exhausted.

By trial and error, I found that there is a list of priorities whenever an url is requested. First, Wordpress will test if it's a category, if match serve, else test if tag, if match serve, else try a search. Anything else (author, date, custom taxonomy, post! etc) is parsed only after.

I know that this particular issue of mine wouldn't warrant any effort, but on the other hand, if there are no hard constraints preventing it, search would be much better suited at the very end of this queue. It's more logical that a search is absolutely the least specific type of url and it may also find it's way in numerous other applications.

So, IMO, url requests should be interpreted as a search only as the very last resort, either by default or at least via some documented hook into the code.

Change History (1)

#1 @Asif2BD
4 years ago

  • Keywords dev-feedback added

Thanks @luciandavidescu for your first ticket.

I would love to see Core Dev Feedback on it. If they feel the same we could look into it more.

Note: See TracTickets for help on using tickets.