wp_title shouldn't use category_name if cat is also specified,
|Reported by:||majelbstoat||Owned by:|
|Component:||Optimization||Keywords:||category wp_title duplicate query optimisation has-patch commit|
A very simple patch. In wp_title(), we test to see if a 'cat' is supplied, generating a title based on that. The next block of code adds an unnecessary database call if 'category_name' is supplied, even if 'cat' was also supplied. We should just ignore the second block of code if we've already determined the cat title from the 'cat' var.
The patch simply adds 'else' to the second block. I can't think of any circumstances where this would be a problem. If the category_name and cat vars didn't map to the same title anyway, there would be bigger problems.