Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

ajax_send_response()

Description

Send AJAX response back to the client together with the appropriate HTTP status code

Parameters

ColumnTypeDefaultDescription
$code integer HTTP status code for this response
$response array Response data (@see other ajax_response_* functions for expected structure)

Return

void

Location

include/ajax_functions.php lines 43 to 48

Definition

 
function ajax_send_response($code, array $response)
    {
    
http_response_code($code);
    echo 
json_encode($response);
    exit();
    }

This article was last updated 19th March 2024 05:05 Europe/London time based on the source file dated 18th August 2023 11:30 Europe/London time.