Closed czernika closed 2 years ago
Hi there,
You're doing everything right :)
This is a known PHP 8 issue and there's a fix in master
for it (https://github.com/htmlburger/wpemerge/commit/b2c8a1b47ba476fc023def17344146816fb18d67) but a full PHP 8-supporting release is not available quite yet because of some WordPress-related complications and lack of time.
Version
Expected behavior
AJAX routes works as expected - send AJAX request and get response
Actual behavior
Error 500 - Unknown named parameter $action
Steps to reproduce (in case of a bug)
ajax.php
This step checked with "usual"
wp_ajax_
actions and its works so nothing wrong with itComments
After some debugging I found out that it pushes
[ 'action' => 'action_name']
route argument withinhandle()
method ofHttpKernel
class. As it passes toHandler's
execute method which has NOT named arguments (it is usesfunc_get_args()
) I guess this is what causing an issue. As a quick fix I had to change a littleHttpKernel::handle
method by adding few extra linesNow it's works (I can see "Hello World" in my console) but I had to change core file. Maybe there is another fix or am I doing AJAX wrong?