[wp-trac] Re: [WordPress Trac] #9269: Proper handling of custom taxonomy in query

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 3 22:50:49 GMT 2009


#9269: Proper handling of custom taxonomy in query
--------------------------+-------------------------------------------------
 Reporter:  dfellars1     |       Owner:  ryan                      
     Type:  defect (bug)  |      Status:  new                       
 Priority:  normal        |   Milestone:  Unassigned                
Component:  Permalinks    |     Version:  2.7.1                     
 Severity:  normal        |    Keywords:  taxonomy wp_queried_object
--------------------------+-------------------------------------------------

Comment(by filosofo):

 Replying to [comment:3 dfellars1]:
 > Wordpress already makes the taxonomy structure public by default -
 apparently just not that many people use it :)

 Not really.  It's your plugin's rewrite rule and consequent query that is
 making public the association between posts and a custom taxonomy.

 > I just want to fix the scenario for when a custom term taxonomy does not
 have any posts associated with it to not return a 404, but to go through
 proper template loading procedures (i.e. check for
 taxonomy-$taxonomy-$term.php, then taxonomy-$taxonomy.php, then
 taxonomy.php) instead of returning a 404 in this scenario.  Especially
 since that is how categories work.

 The problem is that putting something like this in core would be pointless
 without having the prerequisite association between a requested URL and
 query arguments: to load something like {{{taxonomy-*}}} the template
 loader would first need to know that a taxonomy is being requested.
 You're saying you want the cart, and I'm saying we shouldn't even have the
 horse. I would argue against default rewrite rules / query arguments for
 custom taxonomies for several reasons:

  * We don't necessarily want to expose custom taxonomies to public
 queries.
  * Custom taxonomies are often associated with non-post objects.
  * Excess custom taxonomy rewrite rules could present performance
 problems.
  * The current steps necessary to create rewrite rules and query variables
 necessary to query for taxonomies are so minimal, and need for this kind
 of behavior so obscure, that it doesn't warrant the problems that would
 arise by putting it in core.

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


More information about the wp-trac mailing list