Comment_Modal::verify_permission()

Description #

Verify user permission.

Source #

File: ajax/comment-modal.php

	protected function verify_permission() {
		$comment_id = $this->req( 'comment_id' );
		$post_id    = $this->req( 'post_id' );

		if ( ( ! empty( $comment_id ) && ! ap_user_can_edit_comment( $comment_id ) ) || ( ! empty( $post_id ) && ! ap_user_can_comment( $post_id ) ) ) {
			parent::verify_permission();
		}

		// Get comment object.
		if ( ! empty( $comment_id ) ) {
			$_comment = get_comment( $comment_id );
			$this->req( 'post_id', $_comment->comment_post_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