coresocial_ajax_request_error

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
do_action( "coresocial_ajax_request_error", $error, $request, $item, $message, $uid, $code, $data );
coreSocial 4.0 — core/basic/AJAX.php:31, 50, 61, 70, 81, 101, 110, 142, 167, 188
Arguments
Name
Type
Description
$error
string
Internal error identifier.
$request
mixed
Raw or decoded request, or null; depends on the failing check.
$item
mixed
Optional item context; current built-in calls pass null.
$message
string
Human-readable error message, if provided.
$uid
string
Button UID, if known.
$code
int
Optional HTTP status; the built-in error processor defaults to 400.
$data
mixed
Optional extra context; current built-in emission sites do not supply it.

Raw error-dispatch action used by validation failures. Calls supply different numbers of optional arguments; callbacks that request all seven must declare defaults for absent values.

The plugin registers its process_error() callback at priority 10. That callback emits coresocial_ajax_live_handler_error, sends JSON, and exits. To observe this raw action, use a priority below 10; later callbacks may never run.

Prefer coresocial_ajax_live_handler_error for a consistent four-argument error notification. Neither action returns a value to the caller.

Example

add_action( 'coresocial_ajax_request_error', function ( $error ) {
    error_log( 'coreSocial rejected request: ' . $error );
}, 5, 1 );
Rate this reference
0
0
3

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0