Update only if the code got changed

This commit is contained in:
Claudio Sanches 2020-08-03 11:28:27 -03:00
parent 93febdca19
commit f5e1b4fa54
1 changed files with 1 additions and 1 deletions

View File

@ -2211,7 +2211,7 @@ function wc_update_450_sanitize_coupons_code() {
$coupon_id = intval( $data['ID'] );
$code = trim( wp_filter_kses( $data['post_title'] ) );
if ( ! empty( $code ) ) {
if ( ! empty( $code ) && $data['post_title'] !== $code ) {
$wpdb->update(
$wpdb->posts,
array(