WP HOOKS
filtrod 5.5.0

pre_delete_attachment

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

Opis — z kodu źródłowego

Filters whether an attachment deletion should take place.

Parametry

ParametrTypOpis
$delete\WP_Post | false | nullWhether to go forward with deletion.
$post\WP_PostPost object.
$force_deleteboolWhether to bypass the Trash.

Wywołanie

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

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

Popularne w tej kategorii