filtrdynamicznyod 5.0.0
delete_{$meta_type}_metadata_by_mid
Args 2Plik wp-includes/meta.php
Opis — z kodu źródłowego
Short-circuits deleting metadata of a specific type by meta ID.
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). Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
delete_blog_metadata_by_middelete_post_metadata_by_middelete_comment_metadata_by_middelete_term_metadata_by_middelete_user_metadata_by_mid
Hook dynamiczny — możliwe nazwy
delete_blog_metadata_by_middelete_comment_metadata_by_middelete_post_metadata_by_middelete_term_metadata_by_middelete_user_metadata_by_midParametry
| Parametr | Typ | Opis |
|---|---|---|
$delete | null | bool | Whether to allow metadata deletion of the given type. |
$meta_id | int | Meta ID. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'delete_{$meta_type}_metadata_by_mid', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'delete_{$meta_type}_metadata_by_mid', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}