ACF_Ajax::send
send
Sends back JSON based on the $response as either success or failure.
Method of the class: ACF_Ajax{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ACF_Ajax = new ACF_Ajax(); $ACF_Ajax->send( $response );
- $response(mixed) (required)
- The response to send back.
Changelog
| Since 5.7.2 | Introduced. |
ACF_Ajax::send() ACF Ajax::send code ACF 6.0.4
function send( $response ) {
// Return error.
if ( is_wp_error( $response ) ) {
$this->send_error( $response );
// Return success.
} else {
wp_send_json( $response );
}
}