WP HOOKS
filtrod 4.9.0

pre_trash_post

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

Opis — z kodu źródłowego

Filters whether a post trashing should take place.

Parametry

ParametrTypOpis
$trashbool | nullWhether to go forward with trashing.
$post\WP_PostPost object.
$previous_statusstringThe status of the post about to be trashed.

Wywołanie

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

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

Popularne w tej kategorii