[wp-trac] [WordPress Trac] #21106: Unable to add Taxonomies to custom post type taxonomies in 3.4.1

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 3 00:35:14 UTC 2012


#21106: Unable to add Taxonomies to custom post type taxonomies in 3.4.1
----------------------------+--------------------------
 Reporter:  lightmensendme  |       Owner:  markjaquith
     Type:  defect (bug)    |      Status:  reopened
 Priority:  normal          |   Milestone:  3.4.2
Component:  Taxonomy        |     Version:  3.4
 Severity:  major           |  Resolution:
 Keywords:  has-patch       |
----------------------------+--------------------------

Comment (by SergeyBiryukov):

 Closed #21747 as a duplicate.

 In trunk (with jQuery 1.8), the symptoms are different:
 1. The lagging appears when checking any category on a regular Edit Post
 screen as well, in both IE and Firefox.
 2. If there's a taxonomy starting with "even", IE throws an error when
 checking its terms:
 {{{
 Stack overflow at line: 2
 }}}

 Upon debugging, I've found two particular places which seem to be slowing
 things down:
 1. `'[class^="add:' + list.id + ':"]:not(form)'` selector in
 `wpList.process()`:
  http://core.trac.wordpress.org/browser/tags/3.4.1/wp-
 admin/js/post.dev.js#L345 [[BR]]
  As far as I can see, it only runs once, but commenting it out resulted in
 a significant speedup. With the patch from #21152 the results were the
 same, which made me think the culprit here is `:not(form)` rather than the
 `:even` part. Removing `:not(form)` confirmed that.
 2. `'#' + taxonomy + 'checklist li.popular-category :checkbox` selector in
 `post.js`:
  http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/js/wp-
 lists.dev.js#L400
  [http://api.jquery.com/checkbox-selector/ jQuery.com] suggests replacing
 it with `[type="checkbox"]`:
  > Because `:checkbox` is a jQuery extension and not part of the CSS
 specification, queries using `:checkbox` cannot take advantage of the
 performance boost provided by the native DOM `querySelectorAll()` method.
 For better performance in modern browsers, use `[type="checkbox"]`
 instead.

 [attachment:21106.2.patch] fixes the stack overflow in IE and the lagging
 in both Firefox and IE. It should cover all the existing core usage of
 those class names.

 [attachment:21106.3.patch] binds all three non-form functions to both `a`
 and `input` elements, in case plugins might rely on that. Seems is a
 little bit slower, but perhaps safer. Not sure if that's necessary though.

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


More information about the wp-trac mailing list