filtrdynamicznyod 5.0.0
update_{$meta_type}_metadata_cache
Args 2Plik wp-includes/meta.php
Opis — z kodu źródłowego
Short-circuits updating the metadata cache 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_metadata_cacheupdate_post_metadata_cacheupdate_comment_metadata_cacheupdate_term_metadata_cacheupdate_user_metadata_cache
Hook dynamiczny — możliwe nazwy
update_blog_metadata_cacheupdate_comment_metadata_cacheupdate_post_metadata_cacheupdate_term_metadata_cacheupdate_user_metadata_cacheParametry
| Parametr | Typ | Opis |
|---|---|---|
$check | mixed | Whether to allow updating the meta cache of the given type. |
$object_ids | int[] | Array of object IDs to update the meta cache for. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'update_{$meta_type}_metadata_cache', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'update_{$meta_type}_metadata_cache', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}