Merge pull request #7948 from dangh/master

Cannot remove shipping class at quick edit
This commit is contained in:
Mike Jolley 2015-04-14 12:02:17 +01:00
commit 1e06f82f59
2 changed files with 4 additions and 2 deletions

View File

@ -977,7 +977,9 @@ class WC_Admin_Post_Types {
}
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
wp_set_object_terms( $post_id, wc_clean( $_REQUEST['_shipping_class'] ), 'product_shipping_class' );
$shipping_class = '_no_shipping_class' == $_REQUEST['_shipping_class'] ? '' : wc_clean( $_REQUEST['_shipping_class'] );
wp_set_object_terms( $post_id, $shipping_class, 'product_shipping_class' );
}
if ( isset( $_REQUEST['_visibility'] ) ) {

View File

@ -121,7 +121,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="shipping_class" name="_shipping_class">
<option value=""><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
<option value="_no_shipping_class"><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
<?php
foreach ( $shipping_class as $key => $value ) {
echo '<option value="' . esc_attr( $value->slug ) . '">'. $value->name .'</option>';