[wp-trac] [WordPress Trac] #16567: Can't create categories with different names but similar slugs on Edit Post screen

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 25 21:36:41 UTC 2012


#16567: Can't create categories with different names but similar slugs on Edit Post
screen
----------------------------+--------------------
 Reporter:  jeffreymcmanus  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.5
Component:  Administration  |     Version:  3.0.5
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+--------------------

Comment (by technosailor):

 Replying to [comment:12 SergeyBiryukov]:
 > Replying to [comment:11 technosailor]:
 > > I don't agree that wp_insert_term should be where the checks are
 happening. It adds a potentially unneeded query. We should not be doing
 wp_insert_term if term_exists.
 >
 > Quite the contrary, [attachment:16567.2.diff] prevents `term_exists()`
 from being called twice if the term does not exist, since
 `wp_insert_term()` calls it anyway.

 Then `wp_insert_term()` shouldn't be calling it. We shouldn't be doing an
 insert if there is a collision as that adds a DB call.

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


More information about the wp-trac mailing list