如何更改AKISMET评论者隐私声明?

时间:2022-03-01 作者:JamesTheAwesomeDude

我读过the supposed explanation posted on their blog, 然后就没开窍了。

以下特定于站点的插件不起任何作用(我已启用):

<?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>\'
);

?>

如何更改此隐私消息?

1 个回复
SO网友:JamesTheAwesomeDude

啊哈,我终于成功了:

<?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/\'
    );
}

?>

相关推荐

OOP development and hooks

我目前正在为Wordpress编写我的第一个OOP插件。为了帮助我找到一点结构,a boiler plate 这为我奠定了基础。在里面Main.php 有一种方法可以为管理员加载JS和CSS资产:/** * Register all of the hooks related to the admin area functionality * of the plugin. * * @since 0.1.0 * @access private