Send XML response back to AJAX request.
package | WordPress |
---|---|
since | 2.1.0 |
WP_Ajax_Response($args = ''
)
__construct(string|array $args = ''
) : \WP_Ajax_Response
add(string|array $args = ''
) : string
The arguments that can be passed in the $args parameter are below. It is also possible to pass a WP_Error object in either the 'id' or 'data' argument. The parameter isn't actually optional, content should be given in order to send the correct response.
'what' argument is a string that is the XMLRPC response type. 'action' argument is a boolean or string that acts like a nonce. 'id' argument can be WP_Error or an integer. 'old_id' argument is false by default or an integer of the previous ID. 'position' argument is an integer or a string with -1 = top, 1 = bottom, html ID = after, -html ID = before. 'data' argument is a string with the content or message. 'supplemental' argument is an array of strings that will be children of the supplemental element.
since | 2.1.0 |
---|
string
array
Override defaults.
string
XML response.send()
Sets the content type header to text/xml.
since | 2.1.0 |
---|
$responses : array
array()
since | 2.1.0 |
---|---|
access | private |