WordPress at Your Fingertips
function is not described

WC_Post_Data::wp_untrash_post_status() public WC 1.0

Ensure statuses are correctly reassigned when restoring orders and products.

{} It's a method of the class: WC_Post_Data{}

No Hooks.

Return

String.

Usage

$result = WC_Post_Data::wp_untrash_post_status( $new_status, $post_id, $previous_status );
$new_status(string) (required)
The new status of the post being restored.
$post_id(int) (required)
The ID of the post being restored.
$previous_status(string) (required)
The status of the post at the point where it was trashed.

Code of WC_Post_Data::wp_untrash_post_status() WC 5.7.1

public static function wp_untrash_post_status( $new_status, $post_id, $previous_status ) {
	$post_types = array( 'shop_order', 'shop_coupon', 'product', 'product_variation' );

	if ( in_array( get_post_type( $post_id ), $post_types, true ) ) {
		$new_status = $previous_status;
	}

	return $new_status;
}