global namespace function not available in namespaced class constructor

WordPress has global functions such as wp_get_current_user(), which I can call in class methods that are under different namespaces with wp_get_current_user. However I’m not able to do so either in the class constructor or setting it to a variable (class attributes such as $user = wp_get_current_user). I’m guessing there’s a PHP rule that I’m not aware of here?

Read more here: global namespace function not available in namespaced class constructor

Leave a Reply

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