$_POST is always empty
Hello,
I am calling via a WP REST API call (#81) and my action is successfully being called in the background, however, $_POST is always empty.
If I trigger like below:
$data['first_key'] = 'first_value';
$data['second_key'] = 'second_value';
$this->job
->data($data)
->dispatch();
The $_POST in the job handle is always empty.
Any ideas how to debug this to find out why its always empty?
It looks like potentially WordPress has stopped allowing POST data for non-blocking requests:
https://github.com/WordPress/wordpress-develop/blob/c1f2216287d9c097526caa7ecd456891f0c91537/src/wp-includes/class-wp-http.php#L448
It looks like potentially WordPress has stopped allowing POST data for non-blocking requests:
https://github.com/WordPress/wordpress-develop/blob/c1f2216287d9c097526caa7ecd456891f0c91537/src/wp-includes/class-wp-http.php#L448
Hmm, that is strange, and looks to have been the case for a few years.
Did you find a workaround @Jamesking56?
@ianmjones I switched libraries, I use action scheduler instead now.
Thanks for letting me know @Jamesking56, I'll close this for now then as no one else has reported this issue.