[wp-trac] [WordPress Trac] #14458: Create rel_canonical filter

WordPress Trac wp-trac at lists.automattic.com
Fri May 6 14:18:54 UTC 2011


#14458: Create rel_canonical filter
-------------------------+-----------------------------
 Reporter:  wjm          |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Canonical    |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------------
Changes (by husobj):

 * cc: ben@… (added)


Comment:

 @nacin

 True, you could unhook canonical and do it yourself, but that isn't as
 robust as a filter.
 Consider the following scenario.

 If I use an SEO plugin, they will often unhook this and provide their own
 canonical implementation.

 Now if I have a plugin installed that provides fairly complex
 functionality. For example, e-commerce, where you have products which
 would exist in multiple taxonomies under different URL paths. It is likely
 for such a plugin that it would want to override the canonical
 implementation to ensure that the most relevent URL is used as the
 canonical link for a product.

 At this point the e-commerce plugin wouldn't necessarily know where an SEO
 had unhooked canonical and implemented it's own thing so you can't do
 anything about it. At this point it would be more helpful if canonical was
 a filter so that SEO plugins could filter it, then if another plugin wants
 to override if could apply a filter at a higher priority to override it.

 Then say I create I create a plugin to add extra functionality to the
 e-commerce plugin and want to override their canonical functionality, I
 can override their filter.

 I guess because the outcome of canonical should be a single value/output
 it should be a case of whichever plugin "shouts loudest wins" which is
 probably best achieve using a filter?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14458#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list