akcjadynamicznyod 2.9.0
update_{$meta_type}_meta
Args 4Plik wp-includes/meta.php
Opis — z kodu źródłowego
Fires immediately before updating 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:
update_blog_metaupdate_post_metaupdate_comment_metaupdate_term_metaupdate_user_meta
Hook dynamiczny — możliwe nazwy
update_blog_metaupdate_comment_metaupdate_post_metaupdate_term_metaupdate_user_metaParametry
| Parametr | Typ | Opis |
|---|---|---|
$meta_id | int | ID of the metadata entry to update. |
$object_id | int | ID of the object metadata is for. |
$meta_key | string | Metadata key. |
$_meta_value | mixed | Metadata value. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'update_{$meta_type}_meta', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'update_{$meta_type}_meta', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}