wp_anonymize_comment

過濾鉤子
apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment )
引數
  • (bool|string) $anon_message Whether to apply the comment anonymization (bool) or a custom message (string). Default true.
    Required:
  • (WP_Comment) $comment WP_Comment object.
    Required:
  • (array) $anonymized_comment Anonymized comment data.
    Required:
定義位置
相關勾子
wp_insert_commentwp_count_commentsspammed_commentspam_commentrest_allow_anonymous_comments
相關方法
wp_new_commentwp_spam_commentwp_allow_commentwp_insert_commentwp_unspam_commentwp_filter_comment
引入
4.9.6
棄用
-

wp_anonymize_comment:這是 WordPress 中的一個過濾器鉤子,允許開發人員在將評論儲存到資料庫之前對其進行匿名處理。這對於實施隱私法規(例如 GDPR)很有用,這些法規要求從儲存的資料中刪除個人身份資訊。

過濾器是否對評論進行匿名處理。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$anon_message = apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment );
$anon_message = apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment );
$anon_message = apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment );

常見問題

FAQs
檢視更多 >