Add notice on fail

This commit is contained in:
Mike Jolley 2016-02-29 12:33:09 +00:00
parent 09ef555e5a
commit fa2280f3f8
1 changed files with 4 additions and 1 deletions

View File

@ -2298,7 +2298,10 @@ abstract class WC_Abstract_Order {
$update_post_data[ 'post_date_gmt' ] = current_time( 'mysql', 1 );
}
wp_update_post( $update_post_data );
if ( ! wp_update_post( $update_post_data ) ) {
$this->add_order_note( sprintf( __( 'Unable to update order from %s to %s.', 'woocommerce' ), wc_get_order_status_name( $old_status ), wc_get_order_status_name( $new_status ) ), 0, $manual );
return false;
}
$this->add_order_note( trim( $note . ' ' . sprintf( __( 'Order status changed from %s to %s.', 'woocommerce' ), wc_get_order_status_name( $old_status ), wc_get_order_status_name( $new_status ) ) ), 0, $manual );