[wp-trac] [WordPress Trac] #15433: Don't use 'name' query var if 'p' is already set

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 9 03:13:05 UTC 2010


#15433: Don't use 'name' query var if 'p' is already set
--------------------------+-------------------------------------------------
 Reporter:  scribu        |        Owner:          
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:          
Component:  Query         |      Version:          
 Severity:  normal        |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by gazouteast):

 * cc: gazouteast (added)


Comment:

 Replying to [comment:2 filosofo]:
 > This seems inconsistent with other current behavior and is somewhat
 arbitrary.
 >
 > Third, it's not immediately obvious why we should favor ID over name.
 In fact, most sites with "pretty" permalinks on do the majority of their
 single-result queries by post_name, and the general trend in WP seems to
 be away from using IDs as identifiers to using slugs.

 See [http://wordpress.org/support/topic/yet-another-category_id-how-to-
 thread?replies=1] for a real world example of when the ID is needed, not
 the name.  In this case trying to use get_the_category() to get the
 category ID number, to use it as a variable in another function, such that
 the other function then returns data pertinent to the category of the post
 or archive being viewed (in this case from the same numbered Adrotate ad
 group, and NextGEN Gallery ID.

 Because the ID number is constant, whereas the category name (and
 therefore the slug too) is not (due to being editable in admin), using the
 ID numbers for cross-function constancy is the only viable solution ...
 unless you advocate adding another column to the db table to introduce a
 new unique key?

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


More information about the wp-trac mailing list