Description
Hi!
I just discovered that calling endpoints with the basic authentication generates randomly the error (fortunately the majority of calls don't generate any error)
BadMethodCallException: Call to a member function get_page_permastruct() on a non-object (NULL)
The stack trace points to /wp-includes/link-template.php(314): _get_page_link()
.
I'm using the v2 wp rest api plugins and seems that the origin of the error is when this plugin does wp_authenticate.
Any ideas about it?
UPDATE
The error is related to the wp_lostpassword_url
function that is triggered during login. Apparently the function is called during the authentication process in order to return an url where the user could recover his own password. At this point WP isn't able to generate the permalink (may be it is too early). Does anyone know how to disable this call? I implemented a custom password recovery system by the way, so I will never need the build-in method.