• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Akismet::disable_moderation_emails_if_unreachable() – If Akismet is temporarily unreachable, we don’t want to "spam" the blogger with moderation emails for comments that will be automatically cleared or spammed on the next retry.

You appear to be a bot. Output may be restricted

Description

If Akismet is temporarily unreachable, we don't want to "spam" the blogger with moderation emails for comments that will be automatically cleared or spammed on the next retry.

For comments that will be rechecked later, empty the list of email addresses that the moderation email would be sent to.

Usage

$array = Akismet::disable_moderation_emails_if_unreachable( $emails, $comment_id );

Parameters

$emails
( array ) required – An array of email addresses that the moderation email will be sent to.
$comment_id
( int ) required – The ID of the relevant comment.

Returns

array An array of email addresses that the moderation email will be sent to.

Source

File name: akismet/class.akismet.php
Lines:

1 to 16 of 16
  public static function disable_moderation_emails_if_unreachable( $emails, $comment_id ) {
    if ( ! empty( self::$prevent_moderation_email_for_these_comments ) && ! empty( $emails ) ) {
      $comment = get_comment( $comment_id );

      if ( $comment ) {
        foreach ( self::$prevent_moderation_email_for_these_comments as $possible_match ) {
          if ( self::comments_match( $possible_match, $comment ) ) {
            update_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true );
            return array();
          }
        }
      }
    }

    return $emails;
  }
 

 View on GitHub View on Trac

Published: 19th December 2019 | Last updated: 14th November 2021

Primary Sidebar

Information

Function name: Akismet::disable_moderation_emails_if_unreachable
Class ref: Akismet
Plugin ref: Akismet
Version: 5.0.1
Sourcefile: class.akismet.php
File ref: class.akismet.php
Deprecated?: No
API Letters: A,D,E,I,M

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites