Call to undefined function get_usedata() in plugin

After refactoring/restructuring files in my plug-in, I now get the
error

Uncaught Error: Call to undefined function get_userdata()

after code

$current_user_id = get_current_user_id();
$current_user_meta = get_userdata($current_user_id);

in mydomain.local/wp-content/plugins/my-project/my-project.php
I also tried as it was before, in another .php file that was required by my-project.php

These lines are and were appearing quite early in my plug-in code … am I missing some dependency running calling them?

Read more here:: Call to undefined function get_usedata() in plugin

Leave a Reply

Your email address will not be published. Required fields are marked *