WC_Admin_Post_Types::order_updated_messages()publicWC 1.0

Add messages when an order is updated.

Method of the class: WC_Admin_Post_Types{}

No Hooks.

Return

Array.

Usage

$WC_Admin_Post_Types = new WC_Admin_Post_Types();
$WC_Admin_Post_Types->order_updated_messages( $messages );
$messages(array) (required)
Array of messages.

WC_Admin_Post_Types::order_updated_messages() code WC 8.7.0

public function order_updated_messages( array $messages ) {
	global $post, $theorder;

	if ( ! isset( $theorder ) || ! $theorder instanceof WC_Abstract_Order ) {
		if ( ! isset( $post ) || 'shop_order' !== $post->post_type ) {
			return $messages;
		} else {
			\Automattic\WooCommerce\Utilities\OrderUtil::init_theorder_object( $post );
		}
	}

	$messages['shop_order'] = array(
		0  => '', // Unused. Messages start at index 1.
		1  => __( 'Order updated.', 'woocommerce' ),
		2  => __( 'Custom field updated.', 'woocommerce' ),
		3  => __( 'Custom field deleted.', 'woocommerce' ),
		4  => __( 'Order updated.', 'woocommerce' ),
		5  => __( 'Revision restored.', 'woocommerce' ),
		6  => __( 'Order updated.', 'woocommerce' ),
		7  => __( 'Order saved.', 'woocommerce' ),
		8  => __( 'Order submitted.', 'woocommerce' ),
		9  => sprintf(
		/* translators: %s: date */
			__( 'Order scheduled for: %s.', 'woocommerce' ),
			'<strong>' . date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $theorder->get_date_created() ?? $post->post_date ) ) . '</strong>'
		),
		10 => __( 'Order draft updated.', 'woocommerce' ),
		11 => __( 'Order updated and sent.', 'woocommerce' ),
	);

	return $messages;
}