AnsPress_Hooks::edit_comment( $comment_id )

Description #

Edit comment hook callback.

Changelog #

VersionDescription
unknownunknown
4.1.2Introduced.

Source #

File: includes/hooks.php

	public static function edit_comment( $comment_id ) {
		$comment = get_comment( $comment_id );
		$post = ap_get_post( $comment->comment_post_ID );

		if ( ! ap_is_cpt( $post ) ) {
			return;
		}

		$q_id = 'answer' === $post->post_type ? $post->post_parent : $post->ID;
		$a_id = 'answer' === $post->post_type ? $post->ID : 0;

		// Insert activity.
		ap_activity_add( array(
			'q_id'   => $q_id,
			'a_id'   => $a_id,
			'action' => 'edit_c',
      'c_id'   => $comment_id,
		) );
	}

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