update_{$meta_type}_metadata_cache

過濾鉤子
apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids )
引數
  • (mixed) $check Whether to allow updating the meta cache of the given type.
    Required:
  • (int[]) $object_ids Array of object IDs to update the meta cache for.
    Required:
定義位置
相關勾子
update_meta_type_metadataupdate_meta_type_metadata_by_midupdate_meta_type_metaupdated_meta_type_metadelete_meta_type_metadata
相關方法
update_menu_item_cacheupdate_meta_cacheupdate_object_term_cacheupdate_term_cacheupdate_sitemeta_cacheupdate_termmeta_cache
引入
5.0.0
棄用
-

update_{$meta_type}_metadata_cache 是 WordPress 中的一個動作鉤子,在後設資料快取更新後觸發。 此鉤子用於在快取更新完成後執行額外的處理或日誌記錄。

縮短更新特定型別的後設資料快取的時間。

鉤子名稱的動態部分,$meta_type,指的是元物件型別(文章,評論,術語,使用者,或任何其他有相關元表的型別)。返回一個非空值將有效地使該函式短路。

可能的鉤子名稱包括:

  • update_post_metadata_cache
  • update_comment_metadata_cache
  • update_term_metadata_cache
  • update_user_metadata_cache
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );
$check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );
$check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );

常見問題

FAQs
檢視更多 >