+44 0330 223 3428
Call Us
+44 0330 223 3428

Akismet: Customisation options for the Akismet front-end privacy notice

Akismet: Customisation options for the Akismet front-end privacy notice

To help your site be transparent to your visitors about using Akismet to process comments (think privacy and GDPR), our WordPress plugin now gives you the option to display a notice under your site’s comment forms. Site owners can decide if they want to display it, or not, on a per-blog basis.

But we’ve also given options to developers to extend the behaviour, and content, of said notice.

WordPress option

The display of the notice itself, as well as the in-admin notice to set it for one’s site, all revolves around a new akismet_comment_form_privacy_notice option, which needs to be set to either display or hide.

If the option is not yet set, the front-end notice will not be displayed, but the in-admin prompting site owners to set it will.

Once set to either display or hide, the front-end notice will match the choice, and the in-admin notice will disappear.

Filters

In class.akismet.php, there is a new Akismet::display_comment_form_privacy_notice() method, in which you can find the following filters to extend.

  • akismet_comment_form_privacy_notice:
    Overrides the returned value of the akismet_comment_form_privacy_notice option. This value can be display, or hide, and controls the display of the front-end privacy notice under comment forms.
  • akismet_comment_form_privacy_notice_markup:
    Lets you customise the text and markup of the actual notice, which defaults to '<p class="akismet_comment_form_privacy_notice">' . sprintf( __( 'This site uses Akismet to reduce spam. <a href="%s" target="_blank">Learn how your comment data is processed</a>.', 'akismet' ), 'https://akismet.com/privacy/' ) . '</p>'. Note that if you choose to modify the markup, something needs to eventually point your users to https://akismet.com/privacy/, which will always display, or redirect to, our most up-to-date privacy related documentation.

CSS

As seen above, the default front-end privacy notice is wrapped in a <p class="akismet_comment_form_privacy_notice"></p> tag, which you can extend via stylesheets and Javascript.

WP Multisite or multiple WP installs

If you have a lot of sites/blogs, you might also now be wanting to set the privacy display in bulk.

There are a few ways of doing that.

You can create a quick plugin that checks if the akismet_comment_form_privacy_notice option is set, and if it is not, set it for the current blog: update_option( 'akismet_comment_form_privacy_notice', $state ); where $state is either display or hide.

Or you could write a script that loops on your blog list, and set the same option, in one run.


To help your site be transparent to your visitors about using Akismet to process comments (think privacy and GDPR), our WordPress plugin now gives you the option to display a notice under your site’s comment forms. Site owners can decide if they want to display it, or not, on a per-blog basis. But we’ve also given options to developers to extend the behaviour, and content, of said notice. WordPress option The display of the notice itself, as well as the in-admin notice to set it for one’s site, all revolves around a new akismet_comment_form_privacy_notice option, which needs to be set to…

Source: WordPress

Related Post
WPTavern: WordPress Plugin Directory Now Features a Curated Section for Block-Enabled Plugins

WPTavern: WordPress Plugin Directory Now Features a Curated Section for Block-Enabled Plugins If you visit the plugin directory, you will notice a new section at the top featuring block-enabled plugins. WordPress 5.0 has been downloaded more than 8 million times, just one week after its release, and users are looking for blocks to extend the […]

Read more
Dev Blog: WordCamp US 2019 dates announced

Dev Blog: WordCamp US 2019 dates announced Save the date! The next WordCamp US will be held on November 1-3, 2019, in beautiful St Louis, Missouri. One of our largest events of the year, WordCamp US is a great chance to connect with WordPress enthusiasts from around the world. This is also the event that […]

Read more
WPTavern: Interview with Rachel Cherry: Automattic Pledges to Fund WPCampus’ Accessibility Audit of Gutenberg

WPTavern: Interview with Rachel Cherry: Automattic Pledges to Fund WPCampus’ Accessibility Audit of Gutenberg While at WordCamp US, I had the opportunity to catch up with WPCampus director Rachel Cherry, who is coordinating an audit on Gutenberg for the organization she leads. WPCampus launched its crowdfunding campaign at the end of November and more than […]

Read more