AnsPress_Hooks::unpublish_comment( object|array $comment )

Description #

Actions to run after unpublishing a comment.

Parameters #

  • $comment
    object | array (Required) Comment object.

Changelog #

VersionDescription
4.1.2Introduced.

Source #

File: includes/hooks.php

	public static function unpublish_comment( $comment ) {
		$comment = (object) $comment;
		$count = get_comment_count( $comment->comment_post_ID );
		ap_insert_qameta( $comment->comment_post_ID, [ 'fields' => [ 'unapproved_comments' => $count['awaiting_moderation'] ] ] );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment