Cannot remove shipping class at quick edit
This commit is contained in:
parent
80b6c6ca3f
commit
3c9bc90bcc
|
@ -977,7 +977,9 @@ class WC_Admin_Post_Types {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
|
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'] ) ) {
|
if ( isset( $_REQUEST['_visibility'] ) ) {
|
||||||
|
|
|
@ -121,7 +121,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
|
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
|
||||||
<span class="input-text-wrap">
|
<span class="input-text-wrap">
|
||||||
<select class="shipping_class" name="_shipping_class">
|
<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
|
<?php
|
||||||
foreach ( $shipping_class as $key => $value ) {
|
foreach ( $shipping_class as $key => $value ) {
|
||||||
echo '<option value="' . esc_attr( $value->slug ) . '">'. $value->name .'</option>';
|
echo '<option value="' . esc_attr( $value->slug ) . '">'. $value->name .'</option>';
|
||||||
|
|
Loading…
Reference in New Issue