Open vovafeldman opened 7 years ago
What is the reason wp_get_current_user()
is not loaded in current instance?
I'm not sure, is it possible that the cause is because you use custom endpoint for API call (from freemius server to target site?) and WordPress is not actually loaded in this endpoint? (I'm sorry this library is really huge)
If this is the case, I think it's best to add custom endpoint in WordPress instead of adding WordPress to custom endpoint.
Or maybe this endpoint is loaded too early ?
Actual Behavior:
What is the issue? (*)
Apparently, some plugins rely on the fact thatwp-includes/pluggable.php
should be loaded after the plugins so they can override some functions likewp_mail()
. Currently, we are including the file so we can access the context user viawp_get_current_user()
.What is the expected behavior?
Since there are relatively many places we are accessing the context user, it would be pretty complex to rewrite the logic. I think that the best solution would be a reimplementation ofwp_get_current_user()
within the SDK to avoid the inclusion.Versions: (*)
Freemius SDK Version:
1.2.1.7.1WordPress Version:
4.7PHP Version:
7