madeITBelgium / WordPress-PHP-SDK

36 stars 4 forks source link

Can't login #3

Open tamunoemi opened 9 months ago

tamunoemi commented 9 months ago

I get this error "Trying to access array offset on value of type null" when I try to login.

Here is sample code I used $token = WordPress::login($email, $password);

Please help

madeITBelgium commented 9 months ago

Can you sent the full stack trace and output?

gjportegies commented 8 months ago

Same issue here. Tried to login/authenticate with both methods. But I'm getting the following error:

Trying to access array offset on value of type null

Installed on Laravel 10 with PHP 8.1

cubicom commented 7 months ago

It's not working because the code is not correct or not complete. Singleton as service provider is probably not registering correctly or some other issue is there... Apart from that, you need also to set up env variable WORDPRESS_APP_URL

However if you simply instantiate WordPress class, then it is working.