wp_untrash_post_set_previous_status( string $new_status, int $post_id, string $previous_status ): string

In this article

Filters callback which sets the status of an untrashed post to its previous status.

Description

This can be used as a callback on the wp_untrash_post_status filter.

Parameters

$new_statusstringrequired
The new status of the post being restored.
$post_idintrequired
The ID of the post being restored.
$previous_statusstringrequired
The status of the post at the point where it was trashed.

Return

string The new status of the post.

Source

function wp_untrash_post_set_previous_status( $new_status, $post_id, $previous_status ) {
	return $previous_status;
}

Changelog

VersionDescription
5.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.