Enhance rel_canonical function, add filter
|Reported by:||nathanrice||Owned by:||joostdevalk|
|Component:||Canonical||Keywords:||has-patch needs-testing 2nd-opinion|
I think it's a bit shortsighted to think that only singular pages need the canonical tag output in the <head>. Considering the fact that just about any page on your site can be accessed with a malformed URL, I think it's time to enhance this function.
The attached patch is just a first pass. But I think it gets us started in the right direction. There's also a filter before output, so themes and plugins can further enhance the output of this plugin (related #14458).
Patch is against .