How can I get the user to which the IP is related?
-
Using the following code, I want to be able to get the user to which the current IP address is assigned, and then get user meta from that user. Is there a function I can use for this?
wp_get_current_user()
is not returning a valid user.public function isAllowed(): bool
{
if (!is_plugin_active('ip-based-login/ip-based-login.php') || !function_exists('is_logged_in_using_ipbl')) {
return false;
}
$logged_in = is_logged_in_using_ipbl();
if (!$logged_in) {
return false;
}
var_dump('IPBL is active and the user is logged in.');
exit;
//$current_user = ?????
return true;
}
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.