最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

hooks - How to change Akismet commenter privacy notice?

programmeradmin1浏览0评论

I read the supposed explanation posted on their blog, and came away unenlightened.

The following site-specific plugin does nothing (I have enabled it):

<?php
/*
Plugin Name: Akismet Better Privacy Notice
Description: Inform users about what's actually happening with their data
*/

apply_filters(
    'akismet_comment_form_privacy_notice_markup',
    '<p class="akismet_comment_form_privacy_notice">' .
    'Warning: This site uses Akismet to filter spam.' .
    ' Until or unless I can find a suitable replacement anti-spam solution, this means that' .
    ' (per their <a href="%s" target="_blank">indemnification document</a>)' .
    ' <strong>all commenters\' IP addresses will be sent to Automattic, Inc.</strong>,' .
    ' who may choose to share such with 3rd parties.' .
    '<br />If this is unacceptable to you,' .
    ' I highly recommend using an anonymous proxy or public Wi-Fi connection' .
    ' when commenting.' .
    '</p>'
);

?>

How can I change this privacy message?

I read the supposed explanation posted on their blog, and came away unenlightened.

The following site-specific plugin does nothing (I have enabled it):

<?php
/*
Plugin Name: Akismet Better Privacy Notice
Description: Inform users about what's actually happening with their data
*/

apply_filters(
    'akismet_comment_form_privacy_notice_markup',
    '<p class="akismet_comment_form_privacy_notice">' .
    'Warning: This site uses Akismet to filter spam.' .
    ' Until or unless I can find a suitable replacement anti-spam solution, this means that' .
    ' (per their <a href="%s" target="_blank">indemnification document</a>)' .
    ' <strong>all commenters\' IP addresses will be sent to Automattic, Inc.</strong>,' .
    ' who may choose to share such with 3rd parties.' .
    '<br />If this is unacceptable to you,' .
    ' I highly recommend using an anonymous proxy or public Wi-Fi connection' .
    ' when commenting.' .
    '</p>'
);

?>

How can I change this privacy message?

Share Improve this question asked Mar 1, 2022 at 2:42 JamesTheAwesomeDudeJamesTheAwesomeDude 1096 bronze badges 2
  • I am aware that this notice might not technically fulfill the GDPR. That is not an issue, as my jurisdiction of residence isn't under that. I am trying to inform visitors, not satisfy lawyers. – JamesTheAwesomeDude Commented Mar 1, 2022 at 2:44
  • That's not how filters work, the second parameter must be the name of a function to call that returns the new/filtered value, not the new value itself. – Tom J Nowell Commented Mar 1, 2022 at 3:16
Add a comment  | 

1 Answer 1

Reset to default -1

Aha, I finally got it working:

<?php
/*
Plugin Name: Akismet Better Privacy Notice
Description: Inform users about what's actually happening with their data
*/

add_filter (
    'akismet_comment_form_privacy_notice_markup', 'better_display_comment_form_privacy_notice'
);

function better_display_comment_form_privacy_notice() {
    echo sprintf(
        '<p class="akismet_comment_form_privacy_notice">' .
        'Warning: This site uses Akismet to filter spam.' .
        ' Until or unless I can find a suitable replacement anti-spam solution, this means that' .
        ' (per their <a href="%s" target="_blank">indemnification document</a>)' .
        ' <strong>all commenters\' IP addresses will be sent to Automattic, Inc.</strong>,' .
        ' who may choose to share such with 3rd parties.' .
        '<br />If this is unacceptable to you,' .
        ' I highly recommend using an anonymous proxy or public Wi-Fi connection' .
        ' when commenting.' .
        '</p>' ,
        'https://akismet.com/privacy/'
    );
}

?>
发布评论

评论列表(0)

  1. 暂无评论