fix/31824 - Initial commit

This commit is contained in:
John Regan 2022-03-16 09:19:18 -05:00
parent 21ed16c24b
commit 8dbc76ef2b
1 changed files with 12 additions and 1 deletions

View File

@ -175,6 +175,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
try {
throw new ErrorException('message', 0, 1, __FILE__, 179);
/**
* Trigger action before saving to the DB. Allows you to adjust object props before save.
*
@ -200,7 +203,15 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
do_action( 'woocommerce_after_' . $this->object_type . '_object_save', $this, $this->data_store );
} catch ( Exception $e ) {
$this->handle_exception( $e, __( 'Error saving order.', 'woocommerce' ) );
$message_id = $this->get_id() ? $this->get_id() : __( '(no ID)', 'woocommerce' );
$this->handle_exception( $e,
wp_kses_post(
sprintf(
__( 'Error saving order ID %1$s.', 'woocommerce' ),
$message_id
)
)
);
}
return $this->get_id();