Hi. Creating a custom login form and I have a authenticate file in my lib directory.
But for some reason, i can’t seem to call any WP functions.
I also removed the Namespace completely and I’m still getting the same error with or without a namespace.
I attached an img.
Functions aren’t generally touched by the namespace, so it’s strange that yours is erroring out.
You can try forcing PHP to search in the global namespace by using
Edit: actually, perhaps it’s because you are not putting that code into a function or class for a hook. I suppose if you call a function directly underneath a namespace (not within a function or class), then that may be the reason you’re getting an error. Are you sure that code shouldn’t be hooking in somewhere, instead of just when your theme loads?