WP HOOKS
akcjadynamicznyod 3.1.0

delete_{$meta_type}_meta

Args 4Plik wp-includes/meta.php

Opis — z kodu źródłowego

Fires immediately before deleting metadata of a specific type.

The dynamic portion of the hook name, $meta_type, refers to the meta object type (blog, post, comment, term, user, or any other type with an associated meta table). Possible hook names include:

  • delete_blog_meta
  • delete_post_meta
  • delete_comment_meta
  • delete_term_meta
  • delete_user_meta

Hook dynamiczny — możliwe nazwy

delete_blog_metadelete_comment_metadelete_post_metadelete_term_metadelete_user_meta

Parametry

ParametrTypOpis
$meta_idsstring[]An array of metadata entry IDs to delete.
$object_idintID of the object metadata is for.
$meta_keystringMetadata key.
$_meta_valuemixedMetadata value.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'delete_{$meta_type}_meta', 'twoja_funkcja', 10, 4 );

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