coresocial_ajax_live_handler_vote_preprocess

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_vote_preprocess", $break, $request );
coreSocial 4.0 — core/basic/AJAX.php:129
Arguments
Name
Type
Description
$break
bool|array
Initial false allows normal validation. true rejects with the standard error; an array can set code and message.
$request
stdClass
Decoded request after the basic string/id field checks, before full tracking validation.
Returns
false|true|array — Continue, reject with defaults, or reject with code/message overrides.

Runs for tracking requests handled by share(), including share, show, like, and Explore actions. It is not limited to Like votes.

Return false to continue the normal security and target validation. Return true for the default request_invalid error, or an array with code and message. This filter cannot mark an invalid tracking signature as valid.

Example

add_filter( 'coresocial_ajax_live_handler_vote_preprocess', function ( $break, $request ) {
    if ( $request->network === 'qrcode' ) {
        return array( 'code' => 'qr_paused', 'message' => 'QR tracking is temporarily paused.' );
    }
    return $break;
}, 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