WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 2 years ago

#29821 new defect (bug)

bulk_edit_custom_box hook causes tags to display within created fieldset

Reported by: webgeekconsulting Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.0
Component: Quick/Bulk Edit Keywords:
Focuses: Cc:

Description

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:
https://www.dropbox.com/s/fg3tcowz25rdqu1/Screenshot%202014-10-01%2018.53.56.png

Bulk Edit panel with my fieldset:
https://www.dropbox.com/s/mlb4zr6mbvkbnmq/Screenshot%202014-10-01%2018.54.38.png

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:
https://www.dropbox.com/s/haju5pkzu4f80ih/Screenshot%202014-10-01%2019.02.36.png

This is how it should show up.

Change History (4)

#1 @DrewAPicture
5 years ago

  • Component changed from General to Taxonomy

#2 @nacin
5 years ago

  • Component changed from Taxonomy to Quick/Bulk Edit

#3 @barrykooij
4 years ago

I'm having this issue as well in WP 4.3. Did anyone ever look into this?

#4 @adamsilverstein
2 years ago

  • Focuses javascript removed
Note: See TracTickets for help on using tickets.