• 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::update_comment_history() – Log an event for a given comment, storing it in comment_meta.

You appear to be a bot. Output may be restricted

Description

Log an event for a given comment, storing it in comment_meta.

Usage

Akismet::update_comment_history( $comment_id, $message, $event, $meta );

Parameters

$comment_id
( int ) required – The ID of the relevant comment.
$message
( string ) required – The string description of the event. No longer used.
$event
( string ) optional – The event code.
$meta
( array ) optional – Metadata about the history entry. e.g., the user that reported or changed the status of a given comment.

Returns

void

Source

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

1 to 21 of 21
  public static function update_comment_history( $comment_id, $message, $event=null, $meta=null ) {
    global $current_user;

    $user = '';

    $event = array(
      'time'    => self::_get_microtime(),
      'event'   => $event,
    );
    
    if ( is_object( $current_user ) && isset( $current_user->user_login ) ) {
      $event['user'] = $current_user->user_login;
    }
    
    if ( ! empty( $meta ) ) {
      $event['meta'] = $meta;
    }

    // $unique = false so as to allow multiple values per comment
    $r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
  }
 

 View on GitHub View on Trac

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

Primary Sidebar

Information

Function name: Akismet::update_comment_history
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,H,U

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