WP HOOKS
akcjadynamicznyod 6.6.0

delete_post_{$post->post_type}

Args 2Plik wp-includes/post.php

Opis — z kodu źródłowego

Fires immediately before a post is deleted from the database.

The dynamic portion of the hook name, $post->post_type, refers to the post type slug.

Parametry

ParametrTypOpis
$post_idintPost ID.
$post\WP_PostPost object.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'delete_post_{$post->post_type}', 'twoja_funkcja', 10, 2 );

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

Popularne w tej kategorii