[wp-trac] [WordPress Trac] #10786: Implementation of %my_taxonomy% in permastructs is incomplete

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 14 22:04:11 UTC 2009


#10786: Implementation of %my_taxonomy% in permastructs is incomplete
--------------------------+-------------------------------------------------
 Reporter:  johnbillion   |       Owner:  ryan                         
     Type:  defect (bug)  |      Status:  new                          
 Priority:  normal        |   Milestone:  2.9                          
Component:  Permalinks    |     Version:  2.9                          
 Severity:  minor         |    Keywords:  has-patch commit dev-feedback
--------------------------+-------------------------------------------------

Comment(by filosofo):

 Replying to [comment:11 dd32]:
 > > Is there some way we can do this without importing the chief annoyance
 of %category%, namely that the category chosen is always just the one with
 the smallest ID?
 >
 > Only by adding a filter that says "This is the preferred term for this
 taxonomy"

 That filter or some other way of registering a preferred term needs to be
 in place before we do anything like this.  Arbitrarily picking a category
 sort of made sense even as a hack, because there are people who build
 their site structure with categories as hierarchical slots holding
 individual posts.  But it doesn't make sense to take that hack for one
 particular use of one taxonomy and extend it to all taxonomies abstractly.

 > > And can we avoid adding the overhead of looping through all taxonomies
 per given post type,
 > No. You need to loop through the taxonomy list to determine which items
 exist within the current structure, We could cache that value however, But
 seems pointless caching it when realistically, given that looping over
 half a dozen tax's (under normal use) doesnt add much overhead..

 We can avoid the overhead if we register which taxonomies should be
 considered in permalink generation.  In 2.9 we're now registering which
 post types should be public; we may as well do it for taxonomies.

 > > then retrieving all terms of that taxonomy for that post?
 > Caching data again..

 Perhaps, but that's a bandaid for a cut that doesn't need to be inflicted
 in the first place.  Why not just require taxonomies to register if they
 want to be used in permalinks?

 > > * Filter $rewritecode and $rewritereplace so plugins that want to
 employ outre query tags in permalinks can do so easily.
 > WP_Query already supports it, This is purely get_permalink() permalink
 creation which doesnt have it.

 My suggestion seems to have been what you said a from
 [http://core.trac.wordpress.org/ticket/9466#comment:15 a few months ago],
 that is basically allow plugins to do it if they want:

 > Changed 5 months ago by ryan  ¶ [[BR]]
 > [[BR]]
 > How about we remove support for any taxonomy other than category from
 the permalink structure? We shouldn't encourage such things because of
 performance reasons and because of the lack of a default. %tag% is already
 broken, so nothing lost.[[BR]]
 > [[BR]]
 >   Changed 5 months ago by DD32 ¶ [[BR]]
 > [[BR]]
 > Hm... Sounds good to me actually. It'll be far better off in the long
 run. [[BR]]
 > [[BR]]
 > Should be able to be added by a plugin if anyone actually really wants
 it too. [[BR]]

 [[BR]]
 [[BR]]
 [[BR]]


 > > Add an argument to add_rewrite_tag() which puts that tag in the
 $rewritecode pool.
 > The fact that a Rewrite arg is added says "I WANT to use this in
 rewrites"..

 Yes, but rewrites != permalink structure.  A lot of stuff can be used in
 rewrites that doesn't make sense in a permalink structure, because
 permalinks are meant to map one-to-one with a post.

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


More information about the wp-trac mailing list