filtrdynamicznyod 3.1.0
update_{$meta_type}_metadata
Args 5Plik wp-includes/meta.php
Opis — z kodu źródłowego
Short-circuits 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). Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
update_blog_metadataupdate_post_metadataupdate_comment_metadataupdate_term_metadataupdate_user_metadata
Hook dynamiczny — możliwe nazwy
update_blog_metadataupdate_comment_metadataupdate_post_metadataupdate_term_metadataupdate_user_metadataParametry
| Parametr | Typ | Opis |
|---|---|---|
$check | null | bool | Whether to allow updating metadata for the given type. |
$object_id | int | ID of the object metadata is for. |
$meta_key | string | Metadata key. |
$meta_value | mixed | Metadata value. Must be serializable if non-scalar. |
$prev_value | mixed | Optional. Previous value to check before updating. If specified, only update existing metadata entries with this value. Otherwise, update all entries. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'update_{$meta_type}_metadata', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'update_{$meta_type}_metadata', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}