coresocial_ajax_live_handler

Developer Knowledge Level

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!

PHP
Definition
apply_filters( "coresocial_ajax_live_handler", $process, $request );
coreSocial 4.0 — core/basic/AJAX.php:88
Arguments
Name
Type
Description
$process
bool
Initial value is false.
$request
stdClass
Decoded JSON request, before the action/uid gate and tracking validation.
Returns
false — Continue to the standard live handler.

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 );
Rate this reference
0
0
2

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0