WC_Post_Data::wp_untrash_post_status() public WC 1.0
Ensure statuses are correctly reassigned when restoring orders and products.
{} Это метод класса: WC_Post_Data{}
Хуков нет.
Возвращает
Строку.
Использование
$result = WC_Post_Data::wp_untrash_post_status( $new_status, $post_id, $previous_status );
- $new_status(строка) (обязательный)
- The new status of the post being restored.
- $post_id(число) (обязательный)
- The ID of the post being restored.
- $previous_status(строка) (обязательный)
- The status of the post at the point where it was trashed.
Код WC_Post_Data::wp_untrash_post_status() WC Post Data::wp untrash post status WC 5.0.0
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;
}