Comment_Modal::__construct()

Description #

The class constructor.

Set requests and nonce key.

Source #

File: ajax/comment-modal.php

	protected function __construct() {
		$comment_id = ap_sanitize_unslash( 'comment_id', 'r' );

		if ( empty( $comment_id ) ) {
			$this->req( 'post_id', ap_sanitize_unslash( 'post_id', 'r' ) );
			$this->nonce_key = 'new_comment_' . $this->req( 'post_id' );
		} else {
			$this->req( 'comment_id', $comment_id );
			$this->nonce_key = 'edit_comment_' . $comment_id;
		}

		// Call parent.
		parent::__construct();
	}

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