Ajax::send()

Description #

Send ajax response.

Source #

File: classes/ajax.php

	public function send() {
		$this->add_res( 'success', $this->success );
		$this->add_res( 'action', $this->action );

		// Add snackbar message by default if not success.
		if ( false === $this->success && empty( $this->res['snackbar'] ) ) {
			$this->snackbar( __( 'Something went wrong.', 'anspress-question-answer' ) );
		}

		ap_send_json( $this->res );
	}

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