coresocial_ajax_live_handler
This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!
Definition
Arguments
Returns
Runs after POST/nonce/request-size checks and successful JSON-object decoding. The request object has not yet passed the tracking field, signature, network, or public-object checks.
In the current implementation only strict false continues normal handling. Returning any other value goes to the request_incomplete error path; it is not interpreted as a successful custom response.
Use coresocial_ajax_live_handler_vote_preprocess for a supported rejection with an error code and message. The example observes the decoded action while preserving the standard path.
Example
add_filter( 'coresocial_ajax_live_handler', function ( $process, $request ) {
if ( isset( $request->action ) ) {
error_log( 'coreSocial tracking action: ' . sanitize_key( $request->action ) );
}
return $process;
}, 10, 2 );