• 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::last_comment_status() –

You appear to be a bot. Output may be restricted

Description

Usage

Akismet::last_comment_status( $approved, $comment );

Parameters

$approved
( mixed ) required –
$comment
( mixed ) required –

Returns

void

Source

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

1 to 27 of 27
  public static function last_comment_status( $approved, $comment ) {
    if ( is_null( self::$last_comment_result ) ) {
      // We didn't have reason to store the result of the last check.
      return $approved;
    }

    // Only do this if it's the correct comment
    if ( ! self::matches_last_comment( $comment ) ) {
      self::log( "comment_is_spam mismatched comment, returning unaltered $approved" );
      return $approved;
    }

    if ( 'trash' === $approved ) {
      // If the last comment we checked has had its approval set to 'trash',
      // then it failed the comment blacklist check. Let that blacklist override
      // the spam check, since users have the (valid) expectation that when
      // they fill out their blacklists, comments that match it will always
      // end up in the trash.
      return $approved;
    }

    // bump the counter here instead of when the filter is added to reduce the possibility of overcounting
    if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
      update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );

    return self::$last_comment_result;
  }
 

 View on GitHub View on Trac

Published: 19th December 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: Akismet::last_comment_status
Class ref: Akismet
Plugin ref: Akismet
Version: 5.0.1
Sourcefile: class.akismet.php
File ref: class.akismet.php
Deprecated?: No
API Letters: A,C,L,S

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