Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:MDAWaffe/admin ajax

<?xml version="1.0! standalone="yes">
<wp_ajax>
    <response action="$action">
        <$what id="$id" old_id="$old_id">
            <response_data><![CDATA[$data]]></response_data>
            <$supp_key><![CDATA[$supp_val]]></$supp_key>
            ...
        </$what>
    </response>
    ...
</wp_ajax>

Or, if we throw a WP_Error

<?xml version="1.0! standalone="yes">
<wp_ajax>
    <response action="$action">
        <$what id="$id" old_id="$old_id">
            <wp_error code="$error_code"><![CDATA[$error_message]]></wp_error>
            <$supp_key>$supp_val</$supp_key>
            ...
        </$what>
    </response>
    ...
</wp_ajax>

Data in italics is optional.