[wp-trac] [WordPress Trac] #29821: bulk_edit_custom_box hook causes tags to display within created fieldset

WordPress Trac noreply at wordpress.org
Wed Oct 1 23:04:41 UTC 2014


#29821: bulk_edit_custom_box hook causes tags to display within created fieldset
-------------------------------+-----------------------------
 Reporter:  webgeekconsulting  |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  General            |    Version:  4.0
 Severity:  normal             |   Keywords:
  Focuses:  javascript         |
-------------------------------+-----------------------------
 I have a custom post type that I am trying to add some fields to for bulk
 editing. My fieldset displays, but the tags field somehow is getting
 inserted into the fieldset being generated. It's extremely strange.

 Bulk Edit panel without my fieldset:
 [[Image(https://www.dropbox.com/s/fg3tcowz25rdqu1/Screenshot%202014-10-01%2018.53.56.png?dl=1)]]

 Bulk Edit panel with my fieldset:
 [[Image(https://www.dropbox.com/s/mlb4zr6mbvkbnmq/Screenshot%202014-10-01%2018.54.38.png?dl=1)]]

 My code to generate the bulk edit custom box:

 {{{
         /**
          * Display the custom bulk edit box
          *
          * @since 3.0
          * @access public
          * @action bulk_edit_custom_box
          */
         public function bulk_edit_custom_box( $column_name, $post_type ) {
                 if ( $post_type != MP_Product::get_post_type() ||
 $column_name != 'product_price' ) {
                         return;
                 }
                 ?>
 <fieldset id="bulk-edit-col-product-price" class="inline-edit-col-left"
 style="clear:left">
         <div class="inline-edit-col clearfix">
                 <label class="alignleft"><span class="title"><?php
 _e('Price', 'mp'); ?></span><span class="input-text-wrap"><input
 type="text" name="product_price" style="width:100px" /></span></label>
                 <label class="alignleft" style="margin-left:15px"><span
 class="title"><?php _e('Sale Price', 'mp'); ?></span><span class="input-
 text-wrap"><input type="text" name="product_sale_price"
 style="width:100px" /></span></label>
                 <input type="hidden" name="bulk_edit_product_nonce"
 value="<?php echo wp_create_nonce('bulk_edit_product'); ?>" />
         </div>
 </fieldset>
                 <?php
         }
 }}}

 This is the code that is being generated in my debugger:

 {{{
 <fieldset id="bulk-edit-col-product-price" class="inline-edit-col-left"
 style="clear:left"><label class="inline-edit-tags">
                                 <span class="title">Product Tags</span>
                                 <textarea cols="22" rows="1"
 name="tax_input[product_tag]" class="tax_input_product_tag"></textarea>
                         </label>
         <div class="inline-edit-col clearfix">
                 <label class="alignleft"><span
 class="title">Price</span><span class="input-text-wrap"><input
 name="product_price" style="width:100px" type="text"></span></label>
                 <label class="alignleft" style="margin-left:15px"><span
 class="title">Sale Price</span><span class="input-text-wrap"><input
 name="product_sale_price" style="width:100px" type="text"></span></label>
                 <input name="bulk_edit_product_nonce" value="5e55f56276"
 type="hidden">
         </div>
 </fieldset>
 }}}

 Notice how the tags field is being inserted into my fieldset. It seems as
 thought the tags field is being inserted via javascript into whatever the
 last fieldset in the panel is.

 Here's the same fields in the quick edit panel:
 [[Image(https://www.dropbox.com/s/haju5pkzu4f80ih/Screenshot%202014-10-01%2019.02.36.png?dl=1)]]

 This is how it ''should'' show up.

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


More information about the wp-trac mailing list