WP HOOKS
filtrod 5.6.0

wp_untrash_post_status

Args 3Plik wp-includes/post.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the status that a post gets assigned when it is restored from the trash (untrashed).

By default posts that are restored will be assigned a status of 'draft'. Return the value of $previous_status in order to assign the status that the post had before it was trashed. The wp_untrash_post_set_previous_status() function is available for this. Prior to WordPress 5.6.0, restored posts were always assigned their original status.

Parametry

ParametrTypOpis
$new_statusstringThe new status of the post being restored.
$post_idintThe ID of the post being restored.
$previous_statusstringThe status of the post at the point where it was trashed.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_untrash_post_status', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii