WP_Ajax_Response::__construct() WordPress Method
The WP_Ajax_Response::__construct() method allows you to create an AJAX response object. The object can be used to store data that will be sent back to the browser in JSON format.
WP_Ajax_Response::__construct( string|array $args = '' ) #
Constructor – Passes args to WP_Ajax_Response::add().
Description
See also
Parameters
- $args
(string|array)(Optional) Will be passed to add() method.
Default value: ''
Source
File: wp-includes/class-wp-ajax-response.php
public function __construct( $args = '' ) { if ( ! empty( $args ) ) { $this->add( $args ); } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |