[wp-trac] [WordPress Trac] #35349: Tag meta-boxes do not offer suggestions in custom contexts

WordPress Trac noreply at wordpress.org
Thu Jan 7 16:14:23 UTC 2016


#35349: Tag meta-boxes do not offer suggestions in custom contexts
-----------------------------+-----------------------------------
 Reporter:  johnjamesjacoby  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Taxonomy         |    Version:
 Severity:  normal           |   Keywords:  2nd-opinion has-patch
  Focuses:  javascript       |
-----------------------------+-----------------------------------
 I'm registering a custom metaboxes before and after TinyMCE like this:

 {{{
 add_action( 'edit_form_after_title',  'jjj_editor_above' );
 add_action( 'edit_form_after_editor', 'jjj_editor_below' );
 }}}

 These look like:
 {{{
 do_meta_boxes( $GLOBALS['post_type'], 'above_editor', $GLOBALS['post'] );
 do_meta_boxes( $GLOBALS['post_type'], 'below_editor', $GLOBALS['post'] );
 }}}

 When you drag a non-hierarchical taxonomy meta-box into one of these
 custom areas and reload the page, jQuery Suggest stops working. This is
 because:

 `post.js` targets `'#side-sortables, #normal-sortables, #advanced-
 sortables'`

 ...when it could target...

 `.meta-box-sortables`

 ----

 I can fix this myself by copying that bit from `post.js` (see below) but,
 I think WordPress core can safely prevent plugins from needing to handle
 this on their own:
 {{{
 /* Custom Meta Box Locations */
 $( '#above_editor-sortables, #below_editor-sortables' ).children(
 'div.postbox' ).each( function() {
         if ( this.id.indexOf( 'tagsdiv-' ) === 0 ) {
                 window.tagBox && window.tagBox.init();
                 return false;
         }
 } );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35349>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list