WordPress at Your Fingertips
function is not described

WP_Ajax_Response::__construct() public WP 2.1.0

Constructor - Passes args to WP_Ajax_Response::add().

{} It's a method of the class: WP_Ajax_Response{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Ajax_Response = new WP_Ajax_Response();
$WP_Ajax_Response->__construct( $args );
$args(string|array)
Will be passed to add() method.

Notes

Changelog

Since 2.1.0 Introduced.

Code of WP_Ajax_Response::__construct() WP 5.7.2

<?php
public function __construct( $args = '' ) {
	if ( ! empty( $args ) ) {
		$this->add( $args );
	}
}